TinkerTech.net Logo - resources for the aspiring web designer
Google Search
wwwsite

 

Installing SQL Databases on f2o.org

This tutorial is written specifically for students who are using the Dreamweaver MX 2004 with ASP, Coldfusion, and PHP Training from the Source book by Jeffrey Bradzell - ISBN 0-321-24157-6 and f2o.org as the web host. These steps can be modified to work with any MySQL database and host.  If you are using a different host, the steps to install the MySQL database may not work exactly as illustrated.

Connect to f2o using Dreamweaver, WS_FTP, or FireFTP and create a folder called newland inside the public_html directory.

Open the web site that you want to upload in Dreamweaver (Newland Tours).

You will need to change the remote site definition information for the Newland site since you used a local/network connection to test this site.  By this time you should know how to access the Site Definition and how to setup the remote information (Site > Manage Sites).  You should have your f2o account information saved somewhere.  I have included a sample image of my remote information below.  Your FTP host, host directory, and login information will be different.  

Browse to SQL Database

Your Host Directory should include www/public_html/ already. Since I created a folder called newland on the f2o site, my host directory is www/public_html/newland. You will need to be sure to create the newland folder prior to entering the host directory path. If the newland directory does not exist you will get an error message when you attempt to connect.

After setting up the Remote information, click Testing Server in the Category pane.  Change the access to FTP.  The FTP settings should be copied automatically from the Remote Info.  You will need to remove the www/public_html/ from the URL Prefix.  Here is a screen capture of my Testing Server info. By enabling f2o as your testing server you can continue to preview your PHP pages in your web browser. If you disable the testing server you will no longer be able to test your pages automatically in Internet Explorer or Firefox while you are working in Dreamweaver.

Connect to Newland Database

SQL on f2o

Every free f2o.org account gets one database.  This database has already been created and it uses your username as a database name. For example, my username is robin and my database name is robin.  You cannot change the database name, but you can add tables to the database and they can be named whatever you like.  If you have not created any sites that use MySQL your database on f2o should be empty. The process that we are about to walk-thru will install the Newland Tours tables into your database on f2o. 

Modifying the newland_tours.sql file

Open the file inside the Lessons/Lesson08/Start folder called newland_tours.sql in Textpad.

Delete the first two lines of code in the file.

Delete these lines of code

Save the file to your users directory making sure to keep the same filename. Close the file.

Installing the MySQL (newland_tours) database on f2o

Open Internet Explorer and go to the f2o.org web site at http://www.f2o.org. You will need to login to your account by clicking Account Manager (at the top of the f2o.org homepage). 

f2o.org user menuOnce you have logged into your account click the Manage MySQL link. (If you have a paid account this screen may look a little different.)

A new window will open and you will be prompted for your username and password again.

 

 


Newland MySQL

f2o gives you one database to work with.  Your username is used to identify your database.  Notice the image to the left.  It is a screen capture of my PHPMyAdmin screen at f2o.org.       It shows that I have one table named robin.  robin is also my username on f2o.

Note: f2o uses PHPMyAdmin to manage MySQL databases. I have some notes (including links to tutorials) on PHPMyAdmin on this page.

You need to select the database that you want to work with.  To select the database, click the database name in the left frame (circled in the image above).  For example, I would click the database called robin.   A new page should open and you should see a tabbed menu.

Remote Information Newland

Click the SQL tab.  After clicking the SQL tab you should see a box that looks similar to the image below. 

SQL Query Box

Click the Browse button and locate your modified sql file in your site folder and click Open.

Click the Go button.  This will install the SQL tables into your database. A SMALL confirmation box will appear, indicating that your SQL-query has been executed sucessfully.

Import Sucess

Import SQL File Problems

If you receive an error message that the file cannot be read after clicking Go, open the SQL file in TextPad. Highlight the SQL statements beginning with the CREATE TABLE command (see image below) through the ending SQL statement (including the ; semicolon).

Highlighted SQL statements

Press CTRL+C to copy the code.

Return to PHPMyAdmin, select your database and click the SQL tab SQL tab if necessary. Paste (CTRL+V) the SQL code into the Run SQL Query/Queries box.

Run SQL Queries box

Click Go to create the tables.

You should see your tables listed under your database name on the left-hand side of the screen.  Here are my tables (I have two extra tables, admin and contact).

Modify SQL

Changing the connection information in Dreamweaver

Once the tables are installed you will need to change your Newland Tours database connection information in Dreamweaver.  The MySQL Connection information is accessed via the Database Panel (Window > Database) in Dreamweaver. You will need to have a file open to access the Database Panel.  Here is my Database Panel:

Setup SQL

Right click conn_newland and select Edit Connection. You will need to modify the username (use f2o username) password (use f2o password) and the database (use f2o database name).  Here is a screen capture of my MySQL Connection.

Use Database

I would recommend clicking the test button to test the connection.

Once you have followed these steps you can upload/put your site on f2o and everything should work like a charm.

 

Stop by my Amazon Store for gifts for the web developer.

Visit Robin's Blog for more web design and development resources.
©Copyright 2001-2006 - Robin Wood - Send Questions or comments to robin at tinkertech dot net.
Last Updated: December 19, 2006