DEV Community

Discussion on: Create a Query Builder with PHP and SQL

Collapse
 
elvinas profile image
Elvinas

I quite like your Query Builder class, but I have noticed some simple mistakes which should be easy to fix and to understand.

On fetch() method you wrote "return exception;" it should be return "$exception;"
On delete() method you provided return type "bool" in case where PDOException happens you return $exception; in this instance it would return PDOException so it never will be a boolean when something fails. Also the same thing applies for create() method.

Collapse
 
daepher profile image
Daepher

Thank you for your feedback!

Yes, I noticed I've made a few spelling errors and missed some other stuff. I'll revise it, thanks a lot for the help :)