![]() |
Help with MySQL query
Hi folks,
I was wondering if anyone could help me with a query please? I have two mysql databases. The information is contained within the user table. db1 has information in 3 columns which I want to copy to the same columns in db2. And I want to do it with for all users on the forum. Any help would be great. :) Thanks! :) |
I've managed to put this together but it's not working...
Code:
<?php 'vbtest' is the destination database and 'test' is the source database. |
What happens? Do you get an error?
Quote:
|
So I need to connect to two databases at once then?
Both databases have the same username and password if that makes it easier. So am I overcomplicating this? Would this also work? Code:
$dbh1 = mysql_connect($localhost, $username, $password); |
I was just pointing out the code you posted didn't look like it was using the names of the databases you posted. As far as I know, if the databases are on the same server and the database user you're logging in as has the correct permissions on both, then you should be able to do it with something similar to what you originally posted. I'm not sure if what you posted is exaclty the right syntax, I'd have to try it.
|
All times are GMT. The time now is 10:09 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|