Re: MySQL error... but it works!!??
| From: | Mehmet Kamil ERISEN | Date: | Sat, 05 Jan 2002 22:31:56 +0000 |
| Subject: | Re: MySQL error... but it works!!?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79580@lists.php.net to get a copy of this message | ||
Hi,
So far the best way to troubleshoot mysql+php for me has been to add an "or die" after the
sql exec.
$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'") or die ('CAN NOT EXEC SQL');
Or you can do
$sql = "SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'";
echo $sql;
$result = mysql_query($sql) or die .....;
and try to run your sql against mysql directly to make sure your sql is fine.
one thing to always check is your connection to the database..... did you connect?
Simon Kimber <simon@funny.co.uk> wrote: Does anyone have any idea why this is giving me a
"Warning: Supplied
argument is not a valid MySQL result resource in..." error?
The funny thing is that apart from that error message it works perfectly!!
---------------------------
$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'");
while ($sitedata = mysql_fetch_array($result)) {
echo $sitedata['name'] . "
";
}
---------------------------
Cheers
Simon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
Mehmet Erisen
http://www.erisen.com
---------------------------------
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.