0
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 simply doesn't return anything out of the db. The row name is correct and the loop runs, showing that there is something in the database. However the row is just not echoed out at all. This is code i have used a thousand time before and am rather perplexed as to why it has stopped now! Any help, as always, is much appreciated

2 Answers 2

4

replace

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

with

while($row = mysql_fetch_assoc($result))
Sign up to request clarification or add additional context in comments.

1 Comment

No problem, this happens to everyone of us someday, I guess :)
0

did this code give off a notice or warning when you where running it ? I am just curious being that the problem was the semicolon.

1 Comment

while (condition); is the same as while (condition){}, i.e. a while loop with an empty body.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.