abbymsmith
Posts: 23
|
| Posted: 01/03/2009, 6:04 AM |
|
Hi,
CCS 4.1.00.027, MYSQL 5.0, PHP 4.4.9
I have a form which uses a stored procedure to do a custom insert.
The stored procedure takes data from the form and inserts into 3 or 4 different tables in the database.
I would like the ID of the last table inserted to in the stored procedure (LAST_INSERT_ID() in MYSQL) to be available to use on the return page for the custom insert form page.
My first thought was to save that ID to an output variable in the stored procedure, but I couldn't make the custom insert work with the output variable specified. Removing the output variable altogether the procedure works.
I read in several posts on the forums that sp output parameters were previously not supported in CCS, but was hoping maybe it was now? Is it possible to return the ID as an output parameter? If so, what is the correct way to do it, and to store that value for use on a subsequent page?
If it is not possible, is it possible to grab the LAST_INSERT_ID in the After_Execute_Insert of that page, save to a session variable and then use that variable on another page?
Thanks,
Abby
|
 |
 |
datadoit
|
| Posted: 01/03/2009, 6:18 AM |
|
http://us.php.net/mysql_insert_id
|
|
|
 |
|