benjaminmorgan Posted November 19, 2011 Report Share Posted November 19, 2011 What is the difference and which one should be used and why? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 19, 2011 Report Share 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). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.