ohdang888 Posted January 2, 2008 Share Posted January 2, 2008 i want the game pic displayed first, then the link that, while in the database, is in the row as the game picture url. how would i do that? the code i have so far is.... <?php mysql_connect("localhost", "-----", "-------") or die(mysql_error()); mysql_select_db("games") or die(mysql_error()); $new_games = mysql_query("SELECT `link`,`game_picture_url` FROM game ORDER BY `date_added` DESC LIMIT 10") or die(mysql_error()); // below this is when i need help while($row2 = mysql_fetch_array($new_games)){ echo $row2[0]; echo '<br>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/ Share on other sites More sharing options...
pocobueno1388 Posted January 2, 2008 Share Posted January 2, 2008 <?php mysql_connect("localhost", "-----", "-------") or die(mysql_error()); mysql_select_db("games") or die(mysql_error()); $new_games = mysql_query("SELECT link, game_picture_url FROM game ORDER BY date_added DESC LIMIT 10") or die(mysql_error()); while($row2 = mysql_fetch_assoc($new_games)){ echo "<img src='{$row2['game_picture_url']}'><br>"; echo $row2['link'].'<p>'; } ?> Let me know if thats what your trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/#findComment-427836 Share on other sites More sharing options...
ohdang888 Posted January 2, 2008 Author Share Posted January 2, 2008 no errors, its displays the link, but the picture is not being uploaded... i have the webpage and opened it in notepad and this is what it was... <IMG src=""><BR><A href="http://localhost/game.php?title=2deep">2deep</A> <P><IMG src=""><BR><A href="http://localhost/game.php?title=1starship">1StarShip</A> Quote Link to comment https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/#findComment-427854 Share on other sites More sharing options...
rajivgonsalves Posted January 2, 2008 Share Posted January 2, 2008 it looks like $row2['game_picture_url'] is null is it there in the database ? Quote Link to comment https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/#findComment-427863 Share on other sites More sharing options...
ohdang888 Posted January 2, 2008 Author Share Posted January 2, 2008 well there is data in it. and its right too. so thats not the problem... i think i may have messed it up... the pics are stored in a folder called "gamepic" so i did this: echo "<img src=gamepic/'{$row2['game_picture_url']}'><br>"; whats wrong with that? Quote Link to comment https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/#findComment-428493 Share on other sites More sharing options...
ohdang888 Posted January 2, 2008 Author Share Posted January 2, 2008 nvm, i got it wokring! while($row2 = mysql_fetch_assoc($new_games)){ echo '<img src="gamepic/'; echo $row2['game_picture_url']; echo '"><br>'; echo $row2['link'].'<p>'; } Quote Link to comment https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/#findComment-428506 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.