[thelist] undefined index error - PHP and MySQL

Pringle, Ron RPringle at aurora-il.org
Mon May 7 15:29:52 CDT 2007


Ok, thats where I was getting confused then. I kept finding references to mysql_insert_id() returning the wrong value. I'm not using BIGINT so it works fine for me. Thanks again!

Ron


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Jeffrey Barke
Sent: Monday, May 07, 2007 3:23 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] undefined index error - PHP and MySQL


Ron,

No problem. I was poking around a bit more, and this is from the  
PHP.net site:
mysql_insert_id() converts the return type of the native MySQL C API  
function mysql_insert_id() to a type of long (named int in PHP). If  
your AUTO_INCREMENT column has a column type of BIGINT, the value  
returned by mysql_insert_id()  will be incorrect. Instead, use the  
internal MySQL SQL function LAST_INSERT_ID() in an SQL query.

Jeffrey

--
Cheers.
Jeffrey Barke
jeffery.barke at theMechanism.com
Lead Developer, US
theMechanism - New York City
440 9th Avenue, 8th Floor
New York, NY 10001-1631
t: +1 212.404.3150
c: +1 917.941.1232
f: +1 212.404.3228



More information about the thelist mailing list