View Full Version : Trying to pull some information from a MYSQL table

02-09-2010, 10:07 PM
I am trying to extract some games information from the forum database on my website so i can display a random game in a box on the side.

I dont have much experience doing this so i've made a script pulled from a tutorial:


$result = mysql_query("SELECT gname, gtitle, bestscore, gid FROM site_forum.games_list WHERE display = 1 ORDER BY RAND() LIMIT 1") or die(mysql_error());

$num_of_rows = mysql_num_rows ($result);

for ($count = 1; $row = mysql_fetch_row ($result); ++$count)

echo "<img src=\"/forum/arcade/images/$gname2.gif\" width=\"60\" height=\"60\" /><a href=\"/forum/arcade.php?act=Arcade&amp;do=play&amp;gameid=$gameid\">$gtitle</a>";


gives the error:

Unknown column 'display' in 'where clause'

I only want to display an image with the name and score underneath so i need the following rows:

gid, best score, gname, gtitle

from table games_list

in the database site_forum

where am i going wrong?

02-09-2010, 10:49 PM
Is there a field named `display` in the `games_list` table?