Getting Started With MySQLi Dynamic Connections
Dynamic Connections provides various functionality for defining MySQLi Database Connections in Dreamweaver that is otherwise not available in Dreamweaver's default Database Connection interface.
If you often create two different database connection files (one for testing and one for remote), using Dynamic Connections will allow you to create one database connection file that uses the appropriate database based on the domain your page is being displayed on. You can even use this tool if you want to switch databases for different sites.
This Getting Started Guide runs through the process of creating a dynamic MySQLi database connection in Dreamweaver using Dynamic Connections.
Before you will be able to access this option, you must first have defined your Dreamweaver site as a PHP/MySQL site and have the database connection information available.
Simply upload this Connections folder with your site as normal, and Dynamic Connections will make sure to use the right database when necessary.
If you often create two different database connection files (one for testing and one for remote), using Dynamic Connections will allow you to create one database connection file that uses the appropriate database based on the domain your page is being displayed on. You can even use this tool if you want to switch databases for different sites.
This Getting Started Guide runs through the process of creating a dynamic MySQLi database connection in Dreamweaver using Dynamic Connections.
Launch Dynamic Connections
Once installed, this extension adds a Dynamic MySQL Database Connection option to the Dreamweaver Databases panel that you can use to create your database connections going forward.Before you will be able to access this option, you must first have defined your Dreamweaver site as a PHP/MySQL site and have the database connection information available.
- With your PHP page open, click Add (+) from the Databases panel (Window > Databases).
- Choose Dynamic MySQLi Connection to launch the interface.
With this tool installed you will no longer need to use the built-in MySQLi Connection interface provided by Dreamweaver
Primary Connection
The primary connection is the default connection that will be used for any domain that is not configured under Additional Connections.- Enter the details for your primary database connection as you would using Dreamweaver's built-in tool.
- Connection name: Enter a name for this connection. Your connection should not have spaces or any special characters.
- Charset: Select the character encoding preferred for this connection.
If you do not know what this is, leave default selected. - MySQL server: Enter an IP address or the server name for the computer hosting MySQL.
If you are configuring the database connection for you local machine, you can enter localhost. - User name: Enter your MySQL user name.
- Password: Enter your MySQL password
- Database: Enter the name of the database you wish to use, or click Select to choose the database from a list of databases available on the specified server.
- Once entered, choose the Test button to confirm the connection is correct.
- Proceed to the Additional Connections tab to configure details for other databases and domains.
Additional Connections
You can add as many additional connections as you like. Each connection can be associated to any number of domains. When the database connection file is run on a specified domain, it will use the connection that you configured.- Click Add to enter an additional connection.
- In the fields below the tree, enter the details for the connection.
- Use the lightning bolt if you wish to specify any of these values dynamically.
- In the Domains field, enter all the domains (separated by a comma) that you wish this connection to be used for.
- Click Add to create another connection.
- Continue adding connections for all the domains you need.
- Once you have configured all your connections, click Finish to have the connections file created.
Simply upload this Connections folder with your site as normal, and Dynamic Connections will make sure to use the right database when necessary.