benjaminmorgan Posted November 19, 2011 Report Posted November 19, 2011 What is the difference and which one should be used and why?
falkencreative Posted November 19, 2011 Report Posted November 19, 2011 See http://uk3.php.net/manual/en/mysqli.overview.php On the surface, both do about the same thing -- allow you to communicate with a database. MySQLi has some advantages though: - object-oriented interface - support for prepared statements (which prevent SQL injection) - support for multiple statements - support for transactions - enhanced debugging capabilities - embedded server support. I would definitely suggest going with MySQLi or PDO over plain MySQL, since both MySQLi and PDO support prepared statements, which allow you to escape any data that you use in your queries, preventing SQL injection (http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now