View Full Version : How to get the variable from an auto_increment field
Lesane
02-13-2002, 10:17 AM
Edit:
Found it already :)
mysql_insert_id()
Admin
02-13-2002, 12:47 PM
$DB_site->insert_id() with vB's class. :)
Lesane
02-13-2002, 01:06 PM
Thanks :up:
Is there a big difference between:
mysql_insert_id() and LAST_INSERT_ID()?
Admin
02-13-2002, 01:09 PM
A bit. Use LAST_INSERT_ID() in PHP and you will get shout at by the headmaster. ;)
LAST_INSERT_ID() is a MySQL function, to be used within queries. mysql_insert_id() is a PHP function, to be used inside scripts.
But basically they both return the same thing. :)
Lesane
02-13-2002, 01:56 PM
hehe aight, i will gonna use mysql_insert_id() since its a php function ;):)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.