Learning PHP and MySQL

Example 07-02 The SQL to create and populate a purchases table that links user_ids and title_ids

This code is for:
The SQL to create and populate a purchases table that links user_ids and title_ids to a purchase_id

CREATE TABLE `purchases` ( purchase_id int(11NOT NULL auto_increment
                           
user_id varchar(10NOT NULL,
                           
title_id int(11NOT NULL,
                           
purchased timestamp NOT NULL default CURRENT_TIMESTAMP
                           
PRIMARY KEY  (purchase_id));
INSERT INTO `purchasesVALUES (1'mdavis'2'2005-11-26 17:04:29');
INSERT INTO `purchasesVALUES (2'mdavis'1'2005-11-26 17:05:58');

Posted by on 08/18 at 10:41 AM

Next entry: Example 10-01 A simple form example

Previous entry: Example 07-01 Creating the books and authors tables

<< Back to main