Php Mysql Insert Into Two Tables With One Query
- Forums
- MYSQL
- Php Mysql Insert Into Two Tables With One Query
how i can send one query in my php script using mysql database. i want to insert data into two/multiple tables win just one command [2328], Last Updated: Mon Jun 24, 2024
Dounger
Thu Aug 26, 2010
0 Comments
592 Visits
hi i wanted to know if you can show me how i can send one query in my php script using mysql database. i want to insert data into two/multiple tables win just one command. is that possible, and if it is possible can you please show me the code i need to use for inserting correctly into mysql database. i thank you in advance for your help.
i was i reading myself, i want to make sure i make sense ok, because i know what you are going to ask. can you give me example.. hahahah, so her it is
$Query = "INSERT INTO students name='andrew'";
$Query2 = "INSERT INTO books owner='andrew'";
ok, as you can see, i would have to do two queries in order to put data into two different tables, but i want to be able to do the query only once. like i said, i dont know if its even possible, but i would like it if the system was updating the 2 databases tables with just one string.
thanks again