Re: MySQL Errors
| From: | Robert Schipper | Date: | Thu, 21 Oct 2004 12:49:11 +0000 |
| Subject: | Re: MySQL Errors | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24792@lists.php.net to get a copy of this message | ||
hello mikea,
looks like there is something missing in your sourcecode, which you
should have provided. do you give any arguments to
mysql_fetch_array() ? Do you check if it is not false?
your code should look like this:
$sql = "SELECT * FROM example";
$result = mysql_query($sql,$db);
if ($result) {
$myrow=mysql_fetch_array($result);
} else {
echo "ERROR: SQL-query returned false!";
}
Robert
Mikea wrote:
I am getting the following errors when I execute a php script. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource What do I need to make this work? I am new to PHP. I read something about mysql.class.php somewhere. Do I need that somewhere? Do I put an include in the main script? Where does mysql.class.php go directory-wise? I am sure I am not giving enough information and may not be explaining it good enough. My apologies. Again, I am new at this. I appreciate any help. Thank you in advance. Mike