AjaxTutorial PHP MYSQL Websites – 1 (Database Structure)
Learn Ajax in the easiest way ever. Build a full fledged PHP website with MYSQL, CMS using Ajax.
I had picked up an example of an online games website and had build that step by step with downloadable scripts and design. Now I am going to take the same example and write the entire project with Ajax technology. Ajax is the new wonder in web development, the technology that google has embraced with open arms. The reason I am rewriting my old tutorial is for you guys to compare the result and coding difference.
If you are completely new to ajax click here to get the basic information.
Lets start the tutorial, people who have attended my previous set of tutorials will find things repeating (so that’s less work good for you guys!). Check if you have the following installed on your computer:
PHP (click here to install PHP)
IIS or apache (click here to install IIS)
MYSQL (click here to install MYSQL)
PHPmyadmin or SQLAdministrator (click here to install PHPmyadmin)
I assume that is done…
A dynamic website has three main parts:
- Database: To store data
- Website (itself): To view data
- CMS (Content Management Software): To administer data
Database
We will need the 4 following tables
Table 1 – product: to store the products
| Field | Type |
|---|---|
| int(25) | |
| varchar(255) | |
| varchar(255) | |
| text | |
| ddesc | text |
Table 2 – productcategory: to store category of the products
| Field | Type |
|---|---|
| int(11) | |
| int(11) |
Table 3 – category: to store category
| Field | Type |
|---|---|
| char(2) | |
| varchar(100) |
Table 4 – adminuser: to store admin user for the CMS
| Field | Type |
|---|---|
| sno | varchar(50) |
| varchar(50) | |
| password | varchar(50) |
Start phpmyadmin
Open Internet explorer – type – http://localhost/phpmyadmin
Create the above four tables by using phpmyadmin user interface or click on “SQL”, download the file from this webpage and copy paste the code in it
Note: The mysql code is attached with this webpage. Please download it from the top of the page. It contains table structure plus data while above we have only mentioned the structure.