I have several databases that hold user information, but before I completed the code in each php script to add users to each database when joining from one of the 3 different websites, many users joined. Now I have 3 databases that should have the same amount of users b/c each user should have access to each site using there username/password. The problem is that I need to sync up the 3 databases. I have written scripts to dump the data out of one database and copy all of the user information from another, but since the user tables are not the same I would have way too much work involved in modfying each member (over 3000).
My plan was to have a compund select and insert statement to figure out the exact usernames that are new in one database but not in the other. Before I try the insert, I wanted to make sure the where clause in the select returns the correct values, but unfortunately it doesn't. Infact it gives me a result of members X members. This statement in oracle would return the correct value. Whats wrong with this statement and why doesn't it produce the difference instead of the product? Also why don't IN clauses work?
(to find the count, difference between the two db)
use db1;
Select count(*) from user, db2.user where user.username != db2.user.username;
This should return the difference which is like 50 users, but instead gives me the count(*) of db1.user X count(*) of db2.user?
I've also tried
Select count(*) from user, db2.user where user.username not like db2.user.username;
and this gives me an error
Select count(*) from user where username not in (select username from db2.user);
Any help is appriciated. Thanks a bunch
My plan was to have a compund select and insert statement to figure out the exact usernames that are new in one database but not in the other. Before I try the insert, I wanted to make sure the where clause in the select returns the correct values, but unfortunately it doesn't. Infact it gives me a result of members X members. This statement in oracle would return the correct value. Whats wrong with this statement and why doesn't it produce the difference instead of the product? Also why don't IN clauses work?
(to find the count, difference between the two db)
use db1;
Select count(*) from user, db2.user where user.username != db2.user.username;
This should return the difference which is like 50 users, but instead gives me the count(*) of db1.user X count(*) of db2.user?
I've also tried
Select count(*) from user, db2.user where user.username not like db2.user.username;
and this gives me an error
Select count(*) from user where username not in (select username from db2.user);
Any help is appriciated. Thanks a bunch