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
mysqli extension enabled in PHP.
We have configured a database called
book, with the table
cards that has the columns
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 ...