What is PHP-MySQL Bridge?

PHP-MySQL Bridge is a type of connection to your shopping cart to work via Store Manager application. In most cases it is used as alternative connection when MySQL connection to your database is restricted by your server.    

Basically Bridge is a php file that is uploaded to your server automatically and that retrieves your shopping cart data to work in Store Manager application. This type of connection requires synchronization and is good for import, mass upload or mass changes.

While working through Bridge you must store your temporary data somewhere in local database. So you have both your live site database on your server and local database saved on your PC. 

Here is how Bridge connection schema looks like

Bridge.php file is used only for two major operations - retrieve data from remote database and post data to that database. You must understand the difference between Bridge connection and MySQL connection. Bridge is not a connection itself, actually this is just a way to transfer files between remote and local machine and nothing more. Do not use Bridge connection in combination with Direct MySQL connection when working with the same store - it will not damage your data, however, some changes made locally may be lost.

You need to follow some rules while working via PHP-MySQL Bridge connection:

  1. Get Data from Web (CTRL + G) each time you start Store Manager application
  2. Post Changes to Web (CTRL + P) each time you are done with changes or every so often
    *Do not forget to Get Data or Post changes, if you do it once a few days, you may loose local changes
  3. Do not make changes simultaneously from Store Manager installed on multiple PCs if at least one connection is via Bridge
  4. Do not make any changes in admin until you've synchronised changes made locally (see rule 2 above :) )
  5. If you get "Duplicate Entry" error, it means that you broke the above rules and you may loose the changes you've made. In case you've made major changes and you do not want to loose them, check instructions how to fix it.


Pros of this connection type:

  • Allows to work with your data offline, so you can make changes when you're on the road and sync when you're online again 
  • You can undo changes untill they are sent to your website (performing Ctrl+G), thus it is much safer than working with your live site
  • Avoid server overload - making changes locally allows you to use your PC resources to perform "heavy" operations and to post results.   

         
Cons of this connection type:

  • You cannot work from multiple PCs or via Store Manager and admin simultaneously, as you will have outdated information locally 
  • You can loose data when working locally with outdated database as you will need to perform Get Data from Web operation
  • It may take up to 1 hour to synchronise for one-million items sites

The example of PHP-MySQL Bridge connection settings

 

Important note: If you are using Store Manager for Magento or PrestaShop and unable to connect to more than one store, most likely that you have Standard Edition of Store Manager.
In Store Manager the number of store connections depends on the softaware edition. Please, check more details on plans and pricing pages: For Magento - https://www.mag-manager.com/order/, for PrestaShop - https://www.prestashopmanager.com/order/. Thus to manage more than one store, you need to upgrade to PRO Edition. Click here to find out how to upgrade.

 

Video explanation on how Bridge connection works

 

Retrieving data is very similar to restore operation of Backup/Restore Wizard. Actually, the program posts a request to bridge.php file asking it to generate database backup (SQL) script. After script is generated it will be transferred to Store Manager application and executed on database specified in "Store Database Settings" - your local (embedded) database. After this operation you will get mirror copy of your remote (store) database on your local computer.

Select "Tools->Database Bridge->Get Data from Web" to retrieve script file. After script is executed you get complete copy of your remote store on your local machine. You may work with the program now - all modifications one by one will be saved into one file. This file contains all SQL commands modifying your data such as DELETE, INSERT, UPDATE, ALTER and so on.

After the needed modifications are made, you have to update your remote store with all changes done locally. Select "Tools --> Database Bridge --> Post Changes to Web". This action will post all stored commands to bridge.php installed on your store. Once the bridge file receives the commands, it will execute all them one by one in the order they were stored. After all commands are executed successfully, your remote store will reflect all changes you made locally.