Jump to content

[SOLVED] how to display info.


ohdang888

Recommended Posts

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>';
}
?>

Link to comment
https://forums.phpfreaks.com/topic/84053-solved-how-to-display-info/
Share on other sites

<?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.

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>

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.