Prev | Current Page 95 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

com>
Please post comments or corrections to the Author Online forum at
http://www.manning-sandbox.com/forum.jspa?forumID=329
CREATE TABLE `reviews` (
`id` int(11) NOT NULL auto_increment,
`date_created` datetime NOT NULL,
`date_updated` datetime NOT NULL,
`places_id` int(11) NOT NULL, #3
`user_name` varchar(50) NOT NULL,
`body` mediumtext NOT NULL,
`rating` int(11) default NULL,
`helpful_yes` int(11) NOT NULL default '0',
`helpful_total` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
);
INSERT INTO reviews (places_id, body, rating, date_created)
VALUES
(1, 'The facilities here are really good. All the family enjoyed it', 4,
'2007-02-14 00:00:00')
,(1, 'Good day out, but not so many big animals now.', 2,
'2007-02-14 00:00:00')
,(1, 'Excellent food in the cafeteria. Even my 2 year old ate her lunch!', 4,
'2007-02-14 00:00:00');
(annotation) <#1 Primary key is called id and automatically increments. >
(annotation) <#2 Date metadata information is useful to store from the beginning. >
(annotation) <#3 Foreign key to another table is named ???{table name}_id???. >
The SQL in Listing 3.5. needs to be seeded into the database using a MySQL client, such as the command
line mysql application or another one like phpMyAdmin.
3.4.2 Testing our Code
Testing code provides confidence.


Pages:
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
Wczasy nad morzem kasyno kino azjatyckie bwin out of home advertising