Skip to content

Comment on The last PHP wrapper for MySQL you'll ever need

Comments

Ok.. constructive criticism here... not trolling...

A) Not a class. Who writes non-oop PHP anymore? B) Globals. Seriously? What if I need 2 connections in a page load? This won't work. C) Use PDO.

I see the value of the exercise, and I applaude you for it, but PDO has TRILLIONS of sql queries under its belt.

You should use PDO.

One non-obvious benefit of PDO is that it lets you separate data from the query, making it much more secure to SQL injection attacks.

Also, as a rule, never put SQL in the page you're rendering... you want it in another class, away from your code so that you only have to write it once if it's used in numerous places.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.