Re: PHP4.0.1 pl2 and mysql_free_result command
| From: | David Robley | Date: | Thu, 07 Sep 2000 04:13:18 +0000 |
| Subject: | Re: PHP4.0.1 pl2 and mysql_free_result command | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15657@lists.php.net to get a copy of this message | ||
On Thu, 07 Sep 2000, Samantha Savvakis wrote:
> Is there a problem with this command in the PHP4.0.1 pl2 version?
>
> It worked under PHP30.16 and now I'm trying to use this command and I get
> the error:
>
> Warning: Supplied argument is not a valid MySQL result resource in .... on
> line 21
>
> The code looks like this:
>
> // This is my connection function
> $db = db_connection();
>
> $result = mysql_query($sql, $db);
> if ($result)
> {
> $p1ID = mysql_insert_id($db);
> }
> else
> {
> $error = "..";
> }
> mysql_free_result($result);
>
> Any ideas?
> Sam
This is a (very) FAQ; see http://au.net.php:81/FAQ.php#7.12
Essentially you need to check the error message being returned from your
query with mysql_error()
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA