Connecting with PHP

Before we get started we will need to create the database that will be used for this example and ultimately in our final sample project. The SQL code for creating the table is shown in Listing 20.1.

Listing 20.1. The SQL File for Creating the Email Database Table (awad_email.sql)
CREATE TABLE `awad_email` (
    `message` longtext NOT NULL,
    `folder` varchar(50) NOT NULL default '',
    `thread_id` int(11) NOT NULL default '0',
    `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    `subject` varchar(100) NOT NULL default '',
    `sender` varchar(50) NOT NULL default '',
    `receiver` varchar(50) NOT NULL default '',
    `id` int(11) NOT NULL auto_increment,
    PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

PHP ...

Get Ajax for Web Application Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.