mysql_insert_id - link_identifier
| From: | B. Verbeek | Date: | Mon, 28 Jan 2002 11:28:58 +0000 |
| Subject: | mysql_insert_id - link_identifier | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16237@lists.php.net to get a copy of this message | ||
Hello,
How do I use the linkidentifier to get me the last_inserted_id
(mysql_insert_id) from a auto_increment-colomn?
Do I use:
>>
$q_orders_id2 = "INSERT INTO orders(orders_datum, orders_sessid)";
$q_orders_id2.= " VALUES ('$date', '$sid')";
$r_orders_id2 = mysql_query($q_orders_id2, $sqllink_id);
$orders_id = mysql_insert_id($sqllink_id);
<<
"$sqllink_id" must be the inserted value for the auto-increment-colomn named
"orders_id" and is placed in var "$orders_id"
Can anyone tell me if this is correct and what can be done to optimize?
regards
Bart