This may be a step backward from some of the tutorials, but I believe a small refresher can sometimes be a good thing. If you are new to Dreamweaver and are looking to start using the software to develop web applications with PHP and MySQL, then it is important that you have a database connection in place.
If you are new to setting up a PHP/MySQL server, then have a look at my tutorial here.
Creating the Database
Fire up your favaourite browser and point the URL to http://localhost/phpmyadmin or wherever phpMyAdmin is setup on your server. Right off the bat, you are presented with an interface where on the left side, you will have a list of databases already created. On the right, you will have several items being displayed such as the stats on your mySQL server, the ability to create a new database, importing and exporting, theme change etc...
Since we have the Create new database option already available for us, this saves us a lot of digging around. So in the box under the Create new database header, type in the name of your new database and click on the Create button.

If successful, the page will reload and show that the database creation has been successful.

You can now close the phpMyAdmin Interface.
Creating the Database Connection
Fire up Dreamweaver. Open up your site (learn how to create one here). Create a new PHP file and call it say test.php. If the Databases panel is not enabled, click on click on Window > Databases.

Once the Databases panel is up, create a Database connection by clicking the "+" under Databases, and selecting "MySQL Connection".

Fill in all the fields in the MySQL Connection box.

Connection name: Can be any descriptive name
MySQL server: localhost (or server you are using)
User name: your database username
password: your database password
database: your database name
If you wish to test the connection, click on "Test". Otherwise, after filling in all the fields, click on "Ok".
« Previous Article Next Article »

