union-2-table site, PHP-MySQL Course | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
The Testing ServerIf you wish to install a local testing server, you can download the
XAMPP package for Windows http://www.apachefriends.org/en/xampp.html
To make your testing server start automatically
when your computer starts, you can check the Svc checkbox beside both
options. If the XAMPP Control Panel is not already running, go to C:\xampp\control.exe to open the panel. | ||||||||||||||||
1- XAMPP Control Panel | ||||||||||||||||
| ||||||||||||||||
With your testing server now installed and running, there are a few
final steps you should take to make sure everything is configured to work
perfectly.
| ||||||||||||||||
2- List of Files the php, sql and files Folder corresponding, stored at union-2-table Folder: 1- unionall.sql - SQL file 2- index.php and db.php - php files | ||||||||||||||||
| ||||||||||||||||
Defining a Dreamweaver Site | ||||||||||||||||
Once a testing server is set up, either locally or using a remote hosting service, you will need to define a site for Dynamic Development in Dreamweaver | ||||||||||||||||
Step 1: Start the site definition
In Dreamweaver go to Site -> New Site. | ||||||||||||||||
Step 2: Enter the local
Information
In this screen shot, using DW CS6 on a Windows system with XAMPP
installed. you will set the Local Information. This sets the Site Name,
and local path for files in your site. | ||||||||||||||||
| ||||||||||||||||
Step 3: Servers
The next setting is to connect to servers. In DW CS6 and above, this done by selecting the servers section: | ||||||||||||||||
| ||||||||||||||||
and clicking the plus icon to define a new server
connection. at Basic tab, For the Name you can enter the same name as the Site definition, When using a local testing server, set Connect Using to "Local/Network" | ||||||||||||||||
|
||||||||||||||||
Set the Server Folder to the same location as the local
files set in the initial Site Settings. Server Name: union-2-table connect using: Local/Network Server Folder: C:\xampp\htdocs\union-2-table Web URL: http://localhost/union-2-table | ||||||||||||||||
| ||||||||||||||||
at Advanced tab, | ||||||||||||||||
Click the advanced button and set the Application model
to PHP / MySQL Server Model: PHP MySQL | ||||||||||||||||
| ||||||||||||||||
then click Save. Once the connection is defined, there are check boxes to set the connection as a testing or remote connection, check the testing option. | ||||||||||||||||
| ||||||||||||||||
and then Click Save, the Dreamweaver dialog box display: | ||||||||||||||||
Step 4: Manage Sites | ||||||||||||||||
you can edit an existing site definition by going to Site -> Manage Sites. Your Sites: union-2-table | ||||||||||||||||
| ||||||||||||||||
then click Done | ||||||||||||||||
In this section, we'll look into how to create a
database. A database is used to store information for your site. Copy unionall.sql file from ...\\8-Course, union-2-table site, PHP-MySQL\union-2-table Folder to folder C:\xampp\htdocs\union-2-table | ||||||||||||||||
Most web hosts use a control panel for managing your site, in the control panel they will have a way to create a MySQL Database. Once a database has been created, you can use phpMyAdmin to edit it. | ||||||||||||||||
phpMyAdmin is also available using most Local Testing
server packages like XAMPP. The Start pages for those server will have a
link to open phpMyAdmin. In phpMyAdmin, go to the Import tab. Use this .sql script (C:\xampp\htdocs\union-2-table\unionall.sql) to create the unionall database that we will be using : Step 1: import SQL file On the import tab, Click the chose file button, and select the unionall.sql file that you downloaded, and click the Go button to have the database created: | ||||||||||||||||
| ||||||||||||||||
Message about unionall.sql display: Import has been succcessully ... | ||||||||||||||||
| ||||||||||||||||
On the Structure tab, to be Displays:
Database "unionall " stores 2
tables: donor and volunteer | ||||||||||||||||
| ||||||||||||||||
On the Browse tab, to be Displays: the Table "donor" of
Database "unionall " | ||||||||||||||||
| ||||||||||||||||
On the Browse tab, to be Displays: the Table "volunteer" of
Database "unionall " | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
index.php page
File | ||||||||||||||||
Now that a site and a database are created, lets connect
the 2 together. Before creating the database connection, a new PHP file needs to be created and saved to the site | ||||||||||||||||
Step 1: Create a New PHP page
Go to File -> New. In the File Creation dialog, select Blank Page. From the page type section, select PHP and click the create. | ||||||||||||||||
| ||||||||||||||||
Step 2: Save the page to your site
Go to File -> Save. | ||||||||||||||||
| ||||||||||||||||
Step 3: the Site has been
defined - testing server - Once the site has been defined, at Dreamweaver - Dw display current Message: "This page may have dynamically-related files that can only be discovered by the server. Discover | Preferences. | ||||||||||||||||
| ||||||||||||||||
Step 4: Create the connection to the database | ||||||||||||||||
1) open the database panel by going to Window ->
Database. 2) In the database panel, click the plus button and select MySQL Connection 3) enter the: connection name: conunion MySQL server: localhost User name: root Password: Database: unionall | ||||||||||||||||
when click Select Button, to be display Select Database box, select unionall and then click Ok | ||||||||||||||||
| ||||||||||||||||
4) Click the test button then Click OK | ||||||||||||||||
| ||||||||||||||||
5) Click OK | ||||||||||||||||
Step 5: The paragraph Format, the design
Place your cursor in the one cell then Go to Format-> Paragraph Format-> Paragraph. | ||||||||||||||||
| ||||||||||||||||
the Paragraph to be selected ... | ||||||||||||||||
Step 6: The Design and Code of index.php | ||||||||||||||||
the Group of operation consist of the main file - index.php and the part file - db.php of the main | ||||||||||||||||
1- The Design of index.php | ||||||||||||||||
| ||||||||||||||||
2- The Code of index.php | ||||||||||||||||
| ||||||||||||||||
db.php page File | ||||||||||||||||
db.php, Create New PHP file and Save it ... | ||||||||||||||||
the Code, db.php file | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
|