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.