Monday, April 18, 2011

MAKE A CONNECTION TO DATABASE FILE

To make a connection to database in dreamweaver, firstly, you must create a new site. Remember that your site must be saved in folder 'htdocs', and database saved in mysql (for PHP). For ASP, site must be saved in folder 'project/other name' inside folder wwwroot and database save in 'data'.



How to make a Guestbook in Dreamweaver


1. Create new databases using Ms.Access (asp) or phpmyadmin (php).

2. Make a new site in dreamweaver.
- go to site > new site > name your site > choose server technology (ASP vbscript/php mysql)
- choose folder to store your files
- test URL

3. Connecting to a database file.
- Click on the plus (+) and select custom connection string at database tab in application
property.
- type connection name and string.
- testing server

4. Create a register page





5. Inserting data to a database (using recordset)

Open the "MySQL Connection" window
Open the "MySQL Connection" window
  • Configure the MySQL Connection window by giving the connection name of your choice, the MySQL server name, user name and password (if available) and then select a database existent on the server; as the server I am using runs on the local machine I inserted localhost with the default user root and no password. Also, I have previously created a database entitled test with a table inside.

Configure the "MySQL Connection" window

Configure the "MySQL Connection" window

Select the desired database

Select the desired database

  • By accessing Window>Bindings or by pressing Ctrl+F10, open the Bindings panel. By using the plus-like icon, create a Recordset (Query).

Open the "Recordset" window

Open the "Recordset" window

  • Configure the recordset in the Recordset window; you have to give it a name, to select a connection with a database (or click on Define to create a new one), to select a table from the database and define a query. Click on Test to see how the table content is displayed.

Configure the "Recordset" window

Configure the "Recordset" window


No comments:

Post a Comment