Mysql Insert Into Multiple Tables With One Query
Posted On Sun Apr 08, 2012 By jack In MySQL Forums And Topics Discussions About Open Source Database Forums
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
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
Related Content
Information
Forums »
MySQL Forums And Topics Discussions About Open Source Database »
Mysql Insert Into Multiple Tables With One Query
MySQL Forums And Topics Discussions About Open Source Database »
Mysql Insert Into Multiple Tables With One Query
Title: Mysql Insert Into Multiple Tables With One Query
Description: interested in inserting multiple data into multiple tables in mysql database server with just one query command
Tags: mysql ,help ,database ,tutorial ,teach ,learn
Info: This Post Has Been Viewed 0 Times Since
Date: Sun Apr 08, 2012
Author jack Received 0 Replies #939
Date: Sun Apr 08, 2012
Author jack Received 0 Replies #939
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5