ohdang888 Posted January 3, 2008 Share Posted January 3, 2008 the link won't so show up $new_games = mysql_query("SELECT link, game_picture_url, type, counter FROM game ORDER BY counter LIMIT 10") or die(mysql_error()); while($row2 = mysql_fetch_assoc($new_games)){ echo '<td>'; echo'<center>'; echo '<font size=3>'; echo '<img src="gamepic/'; echo $row2['game_picture_url']; echo '" height="120" width="120"><br>'; ?> <a href="game.php?title= <?php echo $row2['title']; ?> "> <?php echo $row2['title']; echo '</a>'; echo '<br>'; echo '<font size=2>'; echo '('; echo $row2['type']; echo ')'; echo '</td>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/84353-why-isnt-this-working/ Share on other sites More sharing options...
p2grace Posted January 3, 2008 Share Posted January 3, 2008 Try this: $new_games = mysql_query("SELECT link, game_picture_url, type, counter FROM game ORDER BY counter LIMIT 10") or die(mysql_error()); while($row2 = mysql_fetch_assoc($new_games)){ extract($row2); echo '<td>'; echo'<center>'; echo '<font size=3>'; echo '<img src="gamepic/'; echo "$game_picture_url"; echo '" height="120" width="120"><br>'; echo '<a href="game.php?title='.$title.'">'; echo "$title"; echo '</a>'; echo '<br>'; echo '<font size=2>'; echo '('; echo "$type"; echo ')'; echo '</td>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/84353-why-isnt-this-working/#findComment-429644 Share on other sites More sharing options...
cooldude832 Posted January 3, 2008 Share Posted January 3, 2008 first off why you breaking out of php to type an agref? secondly clean it up thirdly check for rows like this <?php $new_games ="SELECT link, game_picture_url, type, counter FROM game ORDER BY counter LIMIT 10"; $result = mysql_query($new_games) or die(mysql_error()."<br />".$new_games); if(mysql_num_rows($result)>0){ while($row2 = mysql_fetch_assoc($result)){ echo "<td>"; echo "<center>"; echo "<font size=\"3\">"; echo "<img src=\"gamepic/."$row2['game_picture_url']." height=\"120\" width=\"120\" />"; echo "<br />"; echo "<a href=\"game.php?title=".$row2['title']."\" >"; echo $row2['title']; echo "</a>"; echo "<br />"; echo "<font size=\"2\">"; echo "(".$row2['type'].")"; echo "</td>"; } } else{ echo "No Results Found."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/84353-why-isnt-this-working/#findComment-429647 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.