phpc.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A server for PHP programmers & friends. Join us for discussions on the PHP programming language, frameworks, packages, tools, open source, tech, life, and more.

Administered by:

Server stats:

791
active users

I uncovered a need to perform a nested query recently, but didn't know how to do it using Doctrine DBAL. So, now that I've figured it out, I've blogged about it.

mwop.net/blog/2025-03-06-dbal-

mwop.net · SQL Nested Queries of Sub Queries with Doctrine DBAL
More from Matthew Weier O'Phinney

@mwop

I don't like the following sentence:

> When creating a SELECT using DBAL, you do something like this: $dbal->createQueryBuilder();

DBAL does not force you to use the queryBuilder.

You can just execute the SQL Query as is using fetchAllAssociative.
The queryBuilder is overused for non-dynamic queries in my opinion.

Benjamin Cremer

@mwop SQL is already a language meant to be readable by humans. Why obfuscate it by wrapping it in another language (php).