note 50170 deleted from function.mysql-insert-id by cmb

From: Date: Sun, 16 Feb 2020 13:33:51 +0000
Subject: note 50170 deleted from function.mysql-insert-id by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-214123@lists.php.net to get a copy of this message
Note Submitter: relic at daimi dot au dot dk ---- A bit more on return values: mysql_insert_id() returns 0 if you haven't actually manipulated anything yet. Also, it returns 0 even if the DB connection is lost[0] between inserting and calling mysql_insert_id() - so you can always count on getting an integer. [0] By 'lost' I mean e.g. a DB crash. Actually closing the open link and then trying to communicate with the DB will of course result in an error.

« previous php.notes (#214123) next »