Getting Started With Dreamweaver MX

This article will explain more the Dreamweaver MX development environment, and give you a general overview of the possibilities.

It is extracted from the book Dreamweaver MX: PHP Web Development

File View Columns

File view columns are only available when you click on the  icon in the Site tab of the Files panel.

This opens up a larger window showing each file within your site, along with a number of associated properties. This category of the Advanced Site Definition allows you to change the order of the columns, add a new column, or delete a column. The actual columns themselves represent properties of each file, and these may be either typical file-related properties, or internal pointers to Dreamweaver references.

For example, it is possible to include a column that will specifically map to a value stored as a design note. However, this truly is advanced usage, and is beyond the scope of this book. If you wish to find out more about the customization of the File View Columns, you should consult the Dreamweaver MX User Guide.

Now that we have defined our site, and Dreamweaver has all the settings it needs to manage your workflow, all we need to do is to configure a connection to your MySQL database, and you are ready to begin using the full power of the Dreamweaver MX development environment.

Creating a Database Connection

Database connections are very simple to create. Thankfully Dreamweaver MX handles the majority of this process for you. Armed with your MySQL server information, we shall now look at creating a connection to your database.


To begin creating a database connection we have to turn to the Application panel, and the Databases tab. Before we proceed, if next to the minus button it says "Document Type: HTML", then you must close the currently open document, and create a new PHP File. Why do you have to do this? Well, this comes back to Dreamweaver's Context Sensitivity that we discussed in Chapter 1. Dreamweaver changes the way it works depending on the task at hand and makes available only the tools that you can use. Unfortunately if the default open document is a plain HTML file, Dreamweaver will not allow access to any of its dynamic behaviors, including connections, as they do not apply to a standard HTML page.

Now you have a new blank PHP file open, we can proceed with creating the connection. Returning to the Application panel, click on the plus sign and then click on MySQL Connection.

Before we complete this dialog, it is worthwhile noting that there is a standard naming convention for connections. Whilst not entirely necessary, they can help you identify a reference to the connection if you ever delve in Code View. With connections the naming convention is to prefix your chosen name for the connection with the string 'conn'. In this case, as we are using the Dreamweaver Hotel example that we have already introduced, we will call this connection 'connHotel'.

The MySQL Server value for this dialog should be the hostname or IP Address of your MySQL Server. If your web server is at www.mysite.org, then you would enter www.mysite.org in the MySQL Server textbox.

The username and password information represent the authentication information for your MySQL Server, not your web server. This is often the most common mistake to make when creating a connection.

When you have entered all of the above information that is relevant to your site, click on the Select& button. This will open a new dialog that will allow you to choose your database.

Upon selecting the database from this dialog, click OK, for the name of that database to be entered into the connection dialog. All that now remains is to test the connection by clicking the Test button.

If you have entered the correct details, you will be presented with a message informing you that the connection has tested successfully. When this happens, click OK to complete the Connection Definition process.

With this is done, Dreamweaver MX automatically updates the Databases tab of the Application Panel. From here you can readily see all of the tables and columns within your Database.

Connection Troubleshooting

You could be forgiven for thinking that a dialog as simple as the connection dialogue doesn't pose any problems. As always, this could never be further from the truth.

Here are some common error messages that occur when creating a MySQL Connection:


There are a number of reasons why something similar to this error might occur. The most common of these are that the authentication information is incorrect (that is wrong username or password) or that the MySQL Database has been set to deny remote connections. The denial of remote connections is not a standard MySQL configuration option, and it is therefore unlikely to occur when you are running your own server.

If you receive an error similar to the one above, then Dreamweaver has been unable to locate your MySQL Server. It is likely that either the server is not running, or that the wrong MySQL Server address has been entered.

Bruno Mairlot

Bruno MairlotBruno Mairlot works as full time employee in Security and High Availability company based in Luxembourg. He specialises in developing implementation of network and internet protocols with PHP and MySQL.
He began his working life as founder of a company for website development and network services four years ago, then moved on to work with other companies, but always working mainly as a website developer and security consultant for the web.

See All Postings From Bruno Mairlot >>

Comments

Be the first to write a comment

You must me logged in to write a comment.