RE: [PHP-DB] Querying 2 databases...???

From: Date: Tue, 24 Apr 2001 18:44:41 +0000
Subject: RE: [PHP-DB] Querying 2 databases...???
Groups: php.db 
Request: Send a blank email to php-db+get-8850@lists.php.net to get a copy of this message
Why not just JOIN the tables using new columns in the sportDB? For instance, if your user names in the sportDB database and the user names in the mysql database match up, just do a JOIN ... ON sportdb.table_name.username_field = mysql.user.User You don't need two connections. Jonathan -----Original Message----- From: Russ Michell [mailto:r.j.michell@apu.ac.uk] Sent: Tuesday, April 24, 2001 11:34 AM To: php-db@lists.php.net Subject: [PHP-DB] Querying 2 databases...??? Hi all: I want to be able to update,insert and delete identical information in 2 tables that lie in seperate Databases from my PHPfront-end. The info I am editing is username/access info for table data privileges. One table called 'users' is in my own DB: 'sportDB' and the other is the 'user' table in the 'mysql' database. I'm not sure how to construct the queries and wether or not I need to set up a separate php-$connection setup (running 2: one to connect to my own datatase: 'sportDB' and the other to connect to: 'mysql') I suppose I could include new columns in the 'mysql' database to incorporate the data I'm trying to extract from my 'users' table within 'sportDB', but I'm not sure what effect this may have on the other applications (not mine) that rely on this MySQL installation. Does anyone have any views on this problem or has anyone any whole/partial solutions to point me in the right direction?? I am using php4.0.3pl1 with MySQL3.22.32 on RH6.1 Any help would be very much appreciated. Kind regards: Russ Michell (APU Webteam) #-------------------------------------------------------# "Believe nothing - consider everything" "Web Developers do it on-the-fly." Russ Michell Anglia Polytechnic University Webteam e: r.j.michell@apu.ac.uk w: www.apu.ac.uk/webteam t: +44 (0)1223 363271 x 2331 www.theruss.com #-------------------------------------------------------# -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#8850) next »