View Full Version : little php image help

03-24-2004, 12:11 AM
$con = mysql_connect("localhost","USERNAME","PASWORD");
$db = mysql_select_db("maftystu_mafty",$con);
$sql = "SELECT * FROM `newest work` ORDER BY `id` DESC LIMIT 1";
$result = mysql_query($sql) or die("Error: ".mysql_error());
while($row = mysql_fetch_array($result)){
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr> ";
echo "<td colspan='9'align='center'><a href='$row[1]'target='_blank'><img>$row[2]</img></a></td>";
echo "</tr>";
echo "</table>";

i have my real username and pass in the real one of course, but something is going wrong, and i dont know if its in the php code im putting in dreamweaver, or if its something i did on mySQL. the file extensions i used for my icon image were

../jpegs/abstractspikesPOTM.jpg for the icon and

../jpegs/abstractspikes.jpg for the full image to be showed in a new browser window.

which part am i messing up, you can see my problem here at
in the bottom right you can see were im trying to put my php. hopefully someone can help me :)

03-24-2004, 12:43 AM
To show an image in html, you use <img src="path/to/file"> not <img>path/to/file</img>

03-24-2004, 02:29 AM
ah thank you, worked :D