upgrade, mysql_insert_id broken
| From: | Greg Donald | Date: | Fri, 07 Jul 2000 01:28:13 +0000 |
| Subject: | upgrade, mysql_insert_id broken | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5299@lists.php.net to get a copy of this message | ||
I asked this question a couple of days ago, but none of the replys I
recieved helped.
I upgraded from PHP 3.0.16 to 4.01pl2 /w Zend Optimizer and then my code
started producing errors.
Here's my code:
$sql = "insert into accounts (SiteName,URL,Description) values
('$SiteName','$URL','$Description')";
$result = mysql_query($sql);
$new_id = mysql_insert_id($result); //This is line 121
Here's the error it produces:
Warning: Supplied argument is not a valid MySQL-Link resource in
/usr/www/add.php on line 121
My $new_id value is null, any idea why?
The record gets inserted just fine, but under PHP4.01pl2, mysql_insert_id
doesn't work as advertised.
Thanks,
Greg
------------------------------------------------------------------------
destiney - (des-ti-nêy) - n. 1. deity of all things "html", 2. common
internet addict, 3. lover of late 80's heavy metal music, 4. Activist
for the terminally un-elite; see also - cool guy, des, mr. php...
It's 4:00am, your web site is still up, why are you?
http://destiney.com/
------------------------------------------------------------------------