phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


PHP N-tier: Database Layer Using MySQL

Tag: n-tier, multi-tier, database layer, mysql   Category: PHP Application
post: 12 Mar 2008 read: 443


PHP N-Tier Strategy Step By Step Tutorial - Part 3: For practice, we will build simple application to show 5-tier design. We will begin from database layer. At the database layer, we use MySQL.

Create a database, for example "test". Then create table. This is the query:


CREATE TABLE `books` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 255 ) NOT NULL ,
`author` VARCHAR( 60 ) NOT NULL
) ENGINE = MYISAM ;

Next, try to insert sample data, such as:


INSERT INTO `test`.`books` (
`id` ,
`title` ,
`author`
)
VALUES (
NULL , 'PHP Undercover', 'Wiwit Siswoutomo'
), (
NULL , 'PHP Enterprise', 'Wiwit Siswoutomo'
);

Ok, next post we will try how to connect database use PHP ADOdb as data access tier.




| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting