note 46323 added to function.mysql-insert-id
| From: | sasadotau at osu1 dot php dot net | Date: | Thu, 07 Oct 2004 03:44:26 +0000 |
| Subject: | note 46323 added to function.mysql-insert-id | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78108@lists.php.net to get a copy of this message | ||
As a response to crusaderky at libero dot it, following code won't work for INSERTs because
mysql_query() returns resource identifier only for SELECT,SHOW,EXPLAIN or DESCRIBE statements. If
PHP is to be used with Apache 2 in production environment, Apache's prefork mode should be
used.
<?php
$resource = mysql_query($query);
$id = mysql_insert_id($resource);
?>
----
Manual Page -- http://www.php.net/manual/en/function.mysql-insert-id.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46323
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46323&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46323&report=yes
Search -- http://master.php.net/manage/user-notes.php