unsider Posted March 3, 2008 Share Posted March 3, 2008 I'm quite tired, and I'm having just the hardest time wrapping my head around this.. Not hard, just can't figure it out, I should probably get some sleep as well. echo "<img src='getpicture.php?fid='" . $row["fid"] . '<br>'; Full code here: <?php include ("connect.php"); $query = "SELECT fid FROM files"; $result = mysql_query($query) or die('Error, query failed'); echo '<table>'; while($row = mysql_fetch_array($result)) { echo "<img src='getpicture.php?fid='" . $row["fid"] . '<br>'; } echo '</table>'; ?> Quote Link to comment Share on other sites More sharing options...
trq Posted March 3, 2008 Share Posted March 3, 2008 There is nothing wrong with that code (if not just a little sloppy). What is the error you are getting? Quote Link to comment Share on other sites More sharing options...
Gamic Posted March 3, 2008 Share Posted March 3, 2008 You don't close your <img> tag. <?php echo "<img src='getpicture.php?fid='" . $row["fid"] . '<br>'; ?> Becomes <?php echo "<img src='getpicture.php?fid=" . $row["fid"] . "'><br>"; ?> Quote Link to comment Share on other sites More sharing options...
unsider Posted March 3, 2008 Author Share Posted March 3, 2008 Thanks Gamic, that was the error. And yes, my code is pretty sloppy Quote Link to comment Share on other sites More sharing options...
trq Posted March 3, 2008 Share Posted March 3, 2008 Thats not even a php error, helps if you tell us what errors your getting when you post. Quote Link to comment Share on other sites More sharing options...
kkeim Posted March 3, 2008 Share Posted March 3, 2008 Try using the "ob" functions, makes HTML-PHP more simple rather than coding HTML into a PHP variable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.