mysql_insert_id
| From: | Greg Donald | Date: | Wed, 05 Jul 2000 17:09:58 +0000 |
| Subject: | mysql_insert_id | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-878@lists.php.net to get a copy of this message | ||
I upgraded from PHP 3.0.16 to 4.0.1pl2. Some of my code is broken now and I
don't see why.
$sql = "INSERT INTO categories (Category) VALUES ('$CategoryName')";
$result = mysql_query($sql);
$new_id = mysql_insert_id($sql);
This code now produces this error:
Warning: Supplied argument is not a valid MySQL-Link resource
Not to mention the $new_id is null.
Seems the rules for mysql_insert_id have changed or something. I looked in
the manual but I don't see what is wrong...
This same error is happening consistently everywhere I have used the
mysql_insert_id function. Anyone know why or what I need to do to fix it?
Thanks,
Greg