PHP script not returning db strings

include("conn.php");
$result = mysql_query("SELECT * FROM sggame");

while($row = mysql_fetch_assoc($result));
{
    $id = $row['id'];
    echo $id;
    echo 'working?';
}

      

The above code just doesn't return anything from the db. The row name is correct and the loop runs showing that there is something in the database. However, the line just doesn't reflect at all. This is code that I have used a thousand times before and am pretty perplexed as to why it stops now! Any help is, as always, greatly appreciated

0


source to share


3 answers


replace

while($row = mysql_fetch_assoc($result));

      



from

while($row = mysql_fetch_assoc($result))

      

+4


source


Pretty much the same reason as your last question - annoying semicolons!



0


source


Did this code give a notification or warning when you run it? I'm just curious that the problem was the semicolon.

0


source







All Articles