SQL Query with Multiple Connection Strings
I need to query and link two database that each have their own connection string.
Database 1 Connection String is $rsvp
Database 2 Connection String is $bts
All the tables mentioned here are in $rsvp except for parents
Is there a way to do this?
Here is my query:
<?php
$events = new WA_MySQLi_RS("events",$rsvp,0);
$events->setQuery("Select * from (select * from events) t1 left join (select *, sessionID as thesessionID from sessions where sessionID = ? and start_date > CURDATE()) t2 on (t1.eventID = t2.eventID) left join (select * from locations) t3 on (t1.locationID = t3.locationID) left join (select * from registrants) t4 on (t4.sessionID = t2.sessionID) left join (select * from parents) t5 on (t5.parentID= t4.parentID) group by t2.sessionID order by start_date asc");
$events->bindParam("i", "".$_GET['sessionID'] ."", "-1"); //colname
$events->execute();
?>
Should it be:
$events = new WA_MySQLi_RS(("events",$rsvp,0), ("events",$bts,0));