In the last post we set up the groundwork for our application. Now let’s start building our Zend MVC application and hook it up to a MySQL database.
Database
Use the SQL code below to create the F1 Drivers table we’ll be accessing later on.
CREATE TABLE `f1_drivers` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(250) default NULL,
`team` varchar(250) default NULL,
`points` float default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
INSERT INTO `f1_drivers` (`id`,`name`,`team`,`points`)
VALUES
(1,'Jenson Button','Brawn-Mercedes',21),
(2,'Rubens Barrichello','Brawn-Mercedes',15),
(3,'Jarno Trulli','Toyota',8.5),
(4,'Timo Glock','Toyota',10),
(5,'Nick Heidfeld','BMW Sauber',4),
(6,'Mark Webber','RBR-Renault',9.5),
(7,'Sebastian Vettel','RBR-Renault',10);
Continue reading →