PHP and MySQL Library Tutorial

General
Site Home
LAMP Home
Database Home
Conect to MySQL
MySQL_Login.php
nav.php
dump.php

Clean Up resets the
database to contain
a few sensible
records.

Download Tutorial

Database
Create
Drop

Person Table
Create
Drop

Insert
Delete
Update
Search
Date-Search

Row Dump
Better View 
Table View 
Form View

Book Table
Create
Drop

Insert
Delete
Update
Search




Table View 
Form View

Loan Table
Create
Drop

Insert
Delete

Search




Table View

Documentation
Data Requirements
User Interface Design
Entity Relationship Diagrams
Data Flow Diagrams
Data Dictionary
Implementation Notes
Table Designs
Goals, Testing and Appraisal

Note - Create, Drop and Clean Up would be hidden on a real life system.
Contact - nbauers at samphire dot demon dot co dot uk
Copyright © - You may use and reproduce this material in a "not for profit" setting.

Table Designs

CREATE TABLE person (
    person_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(5),
    last_name VARCHAR(30) NOT NULL,
    first_name VARCHAR(30) NOT NULL,
    date_of_birth DATE
)

CREATE TABLE book (
    accession_num MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    isbn CHAR(13) NOT NULL,
    book_title VARCHAR(100) NOT NULL,
    author VARCHAR(50) NOT NULL,
    publisher VARCHAR(50) NOT NULL
)

CREATE TABLE loan (
    accession_num MEDIUMINT UNSIGNED NOT NULL,
    person_id MEDIUMINT UNSIGNED NOT NULL,
    return_date DATE NOT NULL
)