I am new to my sql and got stuck in a query. The query I am using is as follows;
insert into tableA(fname, lname) values('hello','world'); @id=SELECT LAST_INSERT_ID(); insert into tableB(x,y) values('good', @id); but i am getting an error below;
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@id=SELECT LAST_INSERT_ID()' at line 2 please somebody suggest what is wrong I am doing here, thanks in advance.