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>'; ?> Link to comment https://forums.phpfreaks.com/topic/94146-small-syntax-error/ 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? Link to comment https://forums.phpfreaks.com/topic/94146-small-syntax-error/#findComment-482256 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/94146-small-syntax-error/#findComment-482260 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 Link to comment https://forums.phpfreaks.com/topic/94146-small-syntax-error/#findComment-482266 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. Link to comment https://forums.phpfreaks.com/topic/94146-small-syntax-error/#findComment-482290 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. Link to comment https://forums.phpfreaks.com/topic/94146-small-syntax-error/#findComment-482419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.