Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.