I am trying to display some data via php that i have stored in my mysql database,
I seem to have worked the code out for the text that i want displayed but when i enter the info for the photo that is stored in my mysql i just get the web link displayed instead of the actual image.
My Mysql database structure is as follows:
create table Players ( PlayerID integer not null primary key auto_increment , Forename varchar(50) , Surname varchar(50) not null , DOB date , RegNo tinyint , Photo varchar(255) , Nickname varchar(50) , Comments varchar(255) , Position varchar(50) , GamesPlayed tinyint , GoalsScored tinyint );
My php code is as follows:
<? $username="root"; $password=""; $database="players"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM players"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Database Output</center></b><br><br>"; $i=0; while ($i < $num) { $Forename=mysql_result($result,$i,"Forename"); $Surname=mysql_result($result,$i,"Surname"); $DOB=mysql_result($result,$i,"DOB"); $Nickname=mysql_result($result,$i,"Nickname"); $Photo=mysql_result($result,$i,"Photo"); echo "<b>$Forename$Surname</b><br>Date Of Birth: $DOB<br>Nickname: $Nickname<br>Photo: $Photo<br><br><hr><br>"; $i++; } ?>
the image is stored in the table under the field called Photo, it is stored as a url to the image as follows:
http://uxellaleague.com/images/teams_200506/red_tile.jpg
but is displayed as follows
Chimp
Date Of Birth: 1971-04-08
Nickname: Gaffer
Photo: http://uxellaleague.com/images/teams_200506/red_tile.jpg
E-mail:
Web:
someone has said that this may help but i have no idea how to get it to work, should i leave the words std url in, for example?
$out .= "<img src=\".$prow['Std_URL'])."\" width=\"".$iSize['0']."\" height=\"".$iSize['1']."\" border=\"0\" alt=\"Select this for a more detailed image\">";
Please Help
Thanks in advance
Andy