Re: Retrieve value of newly inserted row.
| From: | Arpad Ray | Date: | Wed, 14 Feb 2007 18:24:45 +0000 |
| Subject: | Re: Retrieve value of newly inserted row. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248874@lists.php.net to get a copy of this message | ||
Dan Shirah wrote:
On my second insert statement, please note "credit_card_id". This is an auto_increment column in table1. What I need to do is pull the value of "credit_card_id" from the newly inserted row from insert1 and put that value in a variable to assign it to "credit_card_id" in insert2.Just append "; SELECT @@identity" to the first query, then fetch the result as normal. Arpad