473,474 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can i insert data in to a table from another database

13 New Member
Hi,
Can any body tell that

suppose i have member table in database1

I want to insert data in to this table, getting data from another database table suppose database2 table

And is it possible ?
Thank you.
May 26 '07 #1
3 30056
Atli
5,058 Recognized Expert Expert
You can do somthing like this.

Expand|Select|Wrap|Line Numbers
  1.  
  2. INSERT INTO 
  3.   db1.myTbl(value)
  4. VALUES
  5.   ((
  6.     SELECT value
  7.     FROM db2.myTbl
  8.     LIMIT 1
  9.   ))
  10.  
May 26 '07 #2
prashanth023
13 New Member
thank you. it will work in normal situation. my requirement is.
i created to objects for two databased located in different servers like this

$obj1= new mysqli("192.168.343.44", "user", "password", "db1");
$obj2=new mysqli("192.325.236.23","user","password","db2");

now we hvae two objects with two databases.

How can i insert into another table from ditterent database.

Help me.

Thank you.
May 28 '07 #3
blossam
29 New Member
Hi,
Can any body tell that

suppose i have member table in database1

I want to insert data in to this table, getting data from another database table suppose database2 table

And is it possible ?
Thank you.

ya it is possible

u can run query like --->

if structure of the both tables are same then...
"insert into database1.member select * from database2.member"

if structure of both tables are not same then
"Insert into database1.member select columnname1,columnname2 from database2.member"

replace columnname1,columnname2 with required field name
May 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Santo Santis | last post by:
How can I make an .exe file that can insert data automatically in a SQLServer database, I can do it in C, but how can I connect to SQLServer and execute a query. All data that I have to insert...
0
by: Dinu | last post by:
Hi All I am trying to insert data within a transaction, into a Db2 database from asp.net. I have created a System DSN using ISeries Access Driver(32 bit) for Windows. I am then connecting...
2
by: Bruce Mogayzel via AccessMonster.com | last post by:
What is the syntax to lookup data in another database? Thanks Bruce -- Message posted via http://www.accessmonster.com
10
by: coffeesin | last post by:
Hi, I have a Table containing these fields: id-no, cold, cold ever, cold date,flu,flu ever and flu date. (The properties of id-no, cold,cold ever,flu,flu ever are set as Numbers.) What i want...
1
by: prasadmummidi | last post by:
do anyone say me how to "insert data into database" in c#.net(connection less). i already created the table in sql server and it has no data in it.
0
by: danishce | last post by:
Hello, I want to insert data directly into my windows form data grid and load a combobox(userid) in the 1st column of data grid,a textbox(password) in 2nd column of datagrid. The code for insert...
2
by: gayano | last post by:
Hi all I'm Trying this code in vb 2005 express The database is sql 2005 express thease textbox are binded with a bindingsource it does not give me a error but it want insert the data to the...
8
by: Betikci Boris | last post by:
Can not insert data into SQLite3 database through browser however i can easily insert data into my db from konsole, in both attmpts i used php 5.2.6 on 2.6.25.* linux kernel i think there is a...
0
by: akshalika | last post by:
I am new to Biztalk. In my project we need to connect oracle database and insert data into oracle table using BizTalk project. I use WCF Adapter pack(SP2). I create biztalk project then using Consume...
17
by: msmjsuarez | last post by:
Hello, I need help... How to automatically insert data to mysql database without submit button using php? Is there a way on this? thanks a lot.
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.