put the following line after you call mysql_query(..), you should be able to see the error:
echo mysql_error(); this line is very handy to see what's wrong with mysql related operation. Remember to delete it after debugging for security reasons Foong Brent Lee <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here is another error I'm getting while trying to view my db. I copied > and pasted these statements from a pdf file I'm using to learn PHP but they > keep creating errors. > I am writing all your tips into my notes to try to keep my questioning > to a minimal. > > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL > result resource in /home/xxxxxxx/public_html/Info/viewdb.php on line 8 > > > > <HTML> > <?php > $db = mysql_connect('localhost', 'xxxxx', 'xxxxxxx'); > mysql_select_db('learndb',$db); > $result = mysql_query("SELECT * FROM personnel",$db); > echo "<TABLE>"; > echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>"; > while ($myrow = mysql_fetch_array($result)) > { > echo "<TR><TD>"; > echo $myrow["firstname"]; > echo " "; > echo $myrow["lastname"]; > echo "<TD>"; > echo $myrow["nick"]; > echo "<TD>"; > echo $myrow["salary"]; > } > echo "</TABLE>"; > ?> > </HTML> > > > -- > > Thanks > ______________________________ > Brent Lee > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php