SQL Articles and Tutorials


April 8, 2014

Building and Executing SQL Queries In Zend

Whilst there are many ways for building and executing SQL queries in Zend Framework 2, the two that I usually use, and which are also used in the ZF2 manual, are closures and the selectWith function. I previously wrote a three part series, showing how to get started using the \Zend\Db\Sql classes with Zend Framework 2, but I didn’t cover how to actually run them. So in today’s tutorial, let’s do that.

April 26, 2013

Are TableGateways Worth it in Zend Framework 2?

Are TableGateways too hard to implement in Zend Framework 2? Too hard to justify the effort? That’s what I was asked recently. So I’ve written this post to show why they’re not, and how they bring great flexibility, when implemented correctly.

April 27, 2013

\Zend\Db\Sql - Creating Joins and Unions with Ease

In part two of the \Zend\Db\Sql\Select series, we create inner, outer, left and right joins as well as union queries with ease. Come learn more about building queries simply, effectively and easily in your every day applications with Zend Framework 2.

April 20, 2013

\Zend\Db\Sql - Build SQL Where Clauses Easily and Efficiently

In this tutorial we’re working through the basics of \Zend\Db\Sql\Where, showing how to build SQL Where clauses for database queries. We’ll show how to create different predicates from simple to nested queries using of and, or, like, between and in conditions.