mysql - I am trying to add information into two tables at the same time. One table -



mysql - I am trying to add information into two tables at the same time. One table -

error when trying populate table

i wanting input info single row within table, first set of info generated form input , sec auto-increment table.

insert bar_location2 (`bar_admitted`) values ("{57}");<br> insert bar_location2 (your_id) select your_id your_detail;

i can execute each query separately , table populate (unfortunately on separate rows), next error when combine two:

1064 - have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'insert bar_location2 (your_id) select your_id your_detail' @ line 2 sql=insert bar_location2 (`bar_admitted`) values ("{57}"); insert bar_location2 (your_id) select your_id your_detail;

i have tried:

start transaction;<br> insert bar_location2 (`bar_admitted`) values ("{57}");<br> insert bar_location2 (your_id) select your_id your_detail;<br> commit;

and 1 time again same error message.

try without braces

insert bar_location2 (bar_admitted) values ("57");

and in form of query

start transaction insert bar_location2 (`bar_admitted`) values ("57"); insert bar_location2 (your_id) select your_detail.your_id your_detail; commit; end of transaction

mysql sql-insert mysql-error-1064

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -