Hi I am brandnew to php and my sql. i am trying to put guest entry to my web.

when i run my web, i get this error : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

Here are the surrounding lines

$SQL="SELECT * From Guestbook";
$Content=mysql_query($SQL);
   while($rs= mysql_fetch_array($Content)){
        echo "$rs[EntryText]";
}

Can anyone see what my problem is?

Try this:

$SQL="SELECT * FROM Guestbook";
$Content=mysql_query($SQL);
if (mysql_num_rows($Content)>0) {
    while($rs= mysql_fetch_array($Content)){
        echo "$rs[EntryText]";
        }
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.