Category: PHP, PHP

There’s many ways to use SQL with PHP and certainly the way to go, even without an ORM or a structured query builder is with PDO. First we’ll initialize the QueryBuilder class utilizing some libraries that already come with PHP such as Exception, PDOException, stdClass and PDO itself.

Inside the fetch method, I’m accessing PDO’s own methods to make the actual queries, and I’m being cautious as to what I’m doing with the information.

I hope you enjoyed this tutorial and that it helped in your adventures with PHP, SQL and PDO.

You can also find this article in my personal blog: https://daepher.com.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners