use PDO ( PHP Data Object ) driver or mysqli.. good for security issues (i.e. sql injection) and much more..
http://trac.jgotti.net/class-db/ is ideal it can be used with mysql, mysqli and sqlite2/3 and you can make your own adapters for it if needed.
You should use PDO (PHP Data Object). It has prepared statemen which can prevent SQL Injection Very easy to use.
As others have said, you should use PDO. It's built into php so it's much much faster than any php scripts.