PHP and MySQL Library Tutorial

General
Site Root
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.

Data Dictionary

PHP and MySQL web based databases are notorious for not working. The most common bug is misspelled data items.

The data dictionary lists all the named items and defines the correct spellings.

Name

Type

Scope

Comment

DATABASE
aardvark MySQL database MySQL DBMS  
PERSON TABLE
person MySQL table aardvark database  
person_id MEDIUMINT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY
person table Primary Key
title VARCHAR(5) person table  
last_name VARCHAR(20) NOT NULL person table Required
first_name VARCHAR(20) NOT NULL person table Required
date_of_birth DATE person table  
BOOK TABLE
book MySQL table aardvark database  
accession_num MEDIUMINT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY
book table Primary Key
isbn CHAR(13) NOT NULL book table Updated ISBN 13 standard - Required
book_title VARCHAR(100) NOT NULL   Required
author VARCHAR(50) NOT NULL   Required
LOAN TABLE
loan MySQL table aardvark database  
loan_id
MEDIUMINT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY
loan table Primary Key
accession_num MEDIUMINT UNSIGNED NOT NULL loan table Required
person_id MEDIUMINT UNSIGNED NOT NULL loan table Required
return_date DATE NOT NULL loan table Required

The MySQL table columns use these names. So do the input form text fields. If you create Flash input forms, these should also use the identical names. Get this right or have no end of trouble!

Hint: Use lower case names and separate words with underscores. Be consistent if you use a different naming scheme.