note 56415 added to function.mysql-insert-id
| From: | bholbrook at servillian dot com | Date: | Thu, 01 Sep 2005 20:50:28 +0000 |
| Subject: | note 56415 added to function.mysql-insert-id | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94626@lists.php.net to get a copy of this message | ||
My apologies for the error below (that was modified out of a class) - as you cannot define a
constant as an array.
replace the line:
<?
define("ID",...);
?>
with
<?
$mysql_id = mysql_query("...");
?>
$mysql_id is now an array in which the first element $mysql_id[0] holds the last inserted id.
Apologies if anyone struggled over that one... esp. the noobs.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-insert-id.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56415
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56415&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56415&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56415&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56415&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56415&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56415&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56415&report=yes
Search -- http://master.php.net/manage/user-notes.php