On Thursday 25 July 2002 00:34, Matthew Bielecki wrote:
> I have a couple of scripts that fail with the error of:
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
> resource in...
>
> I'm new to both SQL and PHP and I'm wondering if I have some setting
> turned off or what.
>
> Here's the piece of code that is failing (the second line fails):
>
> $result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
>         $row = mysql_fetch_array($result);

It's a very good idea to add some error checking code it'll save you a lot of 
grief. See examples in manual for details.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"Nine years of ballet, asshole."
-- Shelly Long, to the bad guy after making a jump over a gorge that he
   couldn't quite, in "Outrageous Fortune"
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to