close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


SQL Query with Multiple Connection Strings

Thread began 5/28/2021 12:42 pm by LWat85283715 | Last modified 5/28/2021 5:46 pm by Ray Borduin | 75 views | 1 replies |


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:

$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

Should it be:

$events = new WA_MySQLi_RS(("events",$rsvp,0), ("events",$bts,0));

Sign in to reply to this post

Ray BorduinWebAssist

Unfortunately I don't think it is possible to select from multiple databases in a single Recordset or query. You would probably have to create two separate recordsets and then merge them with PHP.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...