View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 06-17-2018 , 14:09   Re: PHP+SQL Need help
Reply With Quote #2

mysql_query (and related mysql_ functions) have been deprecated, and won't be there in PHP 7+, so you might want to switch it out to either MySQLi or PDO, to ensure compatibility, in the event that you should ever decide to come out of the stone age.

To grab the "new" ID from auto increment rows, you can use the following:

MySQLi: mixed $mysqli->insert_id;
PDO: public string PDO::lastInsertId ([ string $name = NULL ] )
Legacy stone age functions: int mysql_insert_id ([ resource $link_identifier = NULL ] )
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline