-
Book Overview & Buying
-
Table Of Contents
Zend Framework 2 Cookbook
By :
Querying the database is obviously something that we need to do once we are connected to the database. This recipe explains how this can be done, and the different methods available.
To make full of the following recipe, a Zend Framework 2 skeleton application should be used, with a MySQL server available to connect to. Don't forget that connecting to a MySQL server requires the mysql and mysqli extension enabled in PHP.
We have configured a database called book, with the table cards that has the columns id, color, type, and value. The SQL query to create the database and table are included in the code that comes with the book.
Queries come in all sort of forms, and in this recipe we will discuss some basic querying.
We'll be editing in the /module/Application/src/Application/Controller/IndexController.php file for this example:
<?php namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; class...
Change the font size
Change margin width
Change background colour