• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Select on two diffents databases

asdriel

Member
Apr 26, 2019
199
18
18
www.bantu-2rsn.com
Is there a way to search product on two different websites?
I mean, i have two sites and two databases, so i want to search both products on each site.

is there any soluction??
 
  • Like
Reactions: ibrahim
Make one database for both sites and do the same column for product attributes. that's the best solution. also if you have same design you can white label your website
 
if the databases are on the same server you could create a view - combining product records from Site 1 and Site 2 into the view and then run the new product search against that view.
 
join 2 database to one
exemplar
PHP:
<?php
$pdo = new PDO('mysql:host=localhost;dbname=databaseA', 'root', 'mysql');  //Database 1
$pdo2 = new PDO('mysql:host=localhost;dbname=databaseB', 'root', 'mysql');  //Database 2

$sql = "SELECT a.userID, b.usersFirstName, b.usersLastName  FROM databaseA.dbo.TableA a inner join database B.dbo.TableB b  ON a.userID=b.userID";

foreach ($pdo->query($sql) as $row) {



$jo1 = $row['userID'];
$jo2 = $row['usersFirstName'];


}
?>
 
Last edited:
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock