SQL Articles

Building and Executing SQL Queries In Zend

April 8, 2014

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

Are TableGateways Worth it in Zend Framework 2?

April 26, 2013

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.

Zend\Db\Sql\Select - The Basics (Columns, Limit & Order)

April 2, 2013

In part 3 of this series on \Zend\Db\Sql\Select in Zend Framework 2 We cover the constructor, columns function, aliases and expressions, finishing up with limit and order functions. Come wind up the series in style.

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

April 27, 2013

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.

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

April 20, 2013

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.