Example Of MySQL Insert Into Multiple Tables With One Query
- Forums
- MySQL
- Example Of MySQL Insert Into Multiple Tables With One Query
interested in inserting multiple data into multiple tables in mysql database server with just one query command [939], Last Updated: Sat May 18, 2024
jack
Sun Apr 08, 2012
0 Comments
492 Visits
today i wanted to insert some data into two different tables using mysql and php script.
for example, this is my query:
$Query = "INSERT INTO a.user b.counter SET userid=2,UserName='Walter',counter=23,views=56";
userid will go into the user and counter database table
UserName will go into user table
counter and views will go into counter table
how can i do this without having to use two queries like this:
$Query = "INSERT INTO user SET userid=2,UserName='Walter'";
$Query = "INSERT INTO counter SET counter=23,views=56";
thanks