valid MySQL result resource
| From: | Brent Lee | Date: | Tue, 14 Jan 2003 16:53:57 +0000 |
| Subject: | valid MySQL result resource | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-131582@lists.php.net to get a copy of this message | ||
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