using pics from my database.[Solved]
Posted: Mon Jan 12, 2004 9:08 am
I have a datebase which holds at present 1 table with 6 fields. the last field 'image' holds the path and name of the pic (gifs/1122.jpg) that belongs to the rest of that record. I have done this so that the database doesn't get too big when completely populated.
i am using the following code to output my query to a table on a webpage. how can i adapt this so that i can incorporate img src="$field" and the image be displayed instead of the name of the image. Is this possible or am i thinking pie in the sky
<?
$linkID = @mysql_connect("localhost", "root", "");
mysql_select_db("DBShoes", $linkID);
$resultID = mysql_query("SELECT * FROM tblShoes where gender like '$gender'", $linkID);
print "<table border=1><tr><th> ID</th>";
print "<th>Name></th><th>Gender</th><th>Brand</th><th>Colour</th><th>Picture</th>";
while ($row = mysql_fetch_row($resultID))
{
print "<tr>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print"</table>";
mysql_close($linkID);
?>
Any help appreciated
i am using the following code to output my query to a table on a webpage. how can i adapt this so that i can incorporate img src="$field" and the image be displayed instead of the name of the image. Is this possible or am i thinking pie in the sky
<?
$linkID = @mysql_connect("localhost", "root", "");
mysql_select_db("DBShoes", $linkID);
$resultID = mysql_query("SELECT * FROM tblShoes where gender like '$gender'", $linkID);
print "<table border=1><tr><th> ID</th>";
print "<th>Name></th><th>Gender</th><th>Brand</th><th>Colour</th><th>Picture</th>";
while ($row = mysql_fetch_row($resultID))
{
print "<tr>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print"</table>";
mysql_close($linkID);
?>
Any help appreciated