I\'m having a bit of trouble with the following query:
START TRANSACTION; SET @LASTID = 0; INSERT INTO `Accounts` (
use
SELECT LAST_INSERT_ID();
http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id
Change the last statement into:
SELECT CAST(@LASTID AS integer) as last_id_from_accounts;