Re: Help with msql_fetch_array()
| From: | Jason Wong | Date: | Wed, 24 Jul 2002 19:20:38 +0000 |
| Subject: | Re: Help with msql_fetch_array() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109345@lists.php.net to get a copy of this message | ||
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"
*/