View Full Version : Database Check
Mythotical
12-19-2007, 10:20 PM
Ok I've scrapped the possibly of inserting info upon registration to multiple servers and such.
Now what I want to do is how do I connect to another DB and check it against the master DB for same user accounts, if 1 exists on master DB then it will insert a copy to the secondary DB on a different server. Right now if I can get this to work on the same server, that will do. Basically this will just be a script that runs on the page load or a cron job.
If anyone can give me a suggestion or at least a snippet of code to help me get started, I would very much appreciate it.
Thanks
Steve M
Eikinskjaldi
12-19-2007, 10:35 PM
Ok I've scrapped the possibly of inserting info upon registration to multiple servers and such.
Now what I want to do is how do I connect to another DB and check it against the master DB for same user accounts, if 1 exists on master DB then it will insert a copy to the secondary DB on a different server. Right now if I can get this to work on the same server, that will do. Basically this will just be a script that runs on the page load or a cron job.
If anyone can give me a suggestion or at least a snippet of code to help me get started, I would very much appreciate it.
Thanks
Steve M
If its on the same server then its pretty easy, you can prefix any element of an sql query with the database name
select a.x, b.y from db1.table1 a join db2.table1 b....
you can basically treat the entire system as one big database.
If the second db is on another system then I don't think this will work (I have never tried it) You will need to instantiate a second db wrapper and use that.
In fact, if its on the same server then you can achieve the entire thing with a trigger, and let mysql handle the transaction.
Mythotical
12-20-2007, 05:59 PM
Thanks a bunch. I appreciate the info, I'm gonna give it a try today.
Mythotical
12-22-2007, 12:29 AM
Ok I'm having a big issue looking for the INSERT query thats accessed when a user presses submit on the registration page. Can anyone please give me the file that holds that query so that I can go edit it?
Also, which file holds the SELECT query for the private messages? Its probably in private.php as I have not looked yet but confirm if it is please.
Thanks
Steve
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.