I am trying to run three queries.
Insert user
Insert business with id from user
Update user with id from business
However I am getting no value on my second LAST_INSERT_ID() and no errors on my query
Is there a limit to the number of time you can user LAST_INSERT_ID() in a row?
Code:
INSERT INTO $this->ad_table (username, password, user_email, last_log_time, location, user_group, date_created, time_zone, validation_id)
VALUES ('$uname', '$password', '$_POST[email]', $date, '$_POST[location]', '2', $date, '$_POST[timezone]', '1'
Code:
INSERT INTO $this->ad_table (user_id, contact_name, business_email, catagory, business_name, street_address, city, state, zip_code,
phone_number, fax_number, business_logo, logo_location, affiliate_bs_id, date_created, web_site)
VALUES (LAST_INSERT_ID(), '$_POST[b_contact]', '$_POST[b_email]', '$_POST[b_category]', '$_POST[b_name]', '$_POST[b_street]',
'$_POST[b_city]', '$_POST[b_state]', '$_POST[b_zip]', '$_POST[b_phone]', '$_POST[b_fax]', '$file' , 'Uploads', '$_POST[b_store]', $date, '$_POST[b_web_site]'
Code:
UPDATE $this->ad_table SET store_id = 'LAST_INSERT_ID()' WHERE username = '$uname'
all the variables are correct.
Any Ideas?
Josh