The last PHP wrapper for MySQL you'll ever need
github.com
github.com
This has the limitation of not being able to chain queries via OOP, but does use PDO and is tested enough to be considered stable.
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.
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.
More critically, you're using a lot of addslashes, which is not a safe way to escape input. You need to use mysql_real_escape_string or you're open to injection attacks.