Mudsaf Posted August 21, 2013 Share Posted August 21, 2013 Hello, i'm wondering that is there possibility to MySQLi extension get removed since there is PDO with way more Database supporting and only a little slower. Is the PDO new future of Database coding? If not why should i learn MySQLi instead of PDO straight away? MySQLi: http://php.net/manual/en/book.mysqli.php PDO: http://php.net/manual/en/book.pdo.php Reply what you think about this topic. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 21, 2013 Share Posted August 21, 2013 PDO is more flexible, you should use PDO for any new application where the actual database might change. If you switch from MySQL to PostgreSQL, for example, and you used mysqli, then you have to write code. If you use PDO then you just change the connection and driver information. That being said, the mysqli extension is not difficult to learn, there's not much to it. Most of the work with databases is designing the structure and writing the actual SQL statements, not learning the API. The APIs have fairly standard capabilities, just slightly different syntax. Link to comment Share on other sites More sharing options...
Mudsaf Posted August 21, 2013 Author Share Posted August 21, 2013 So do you think that MySQLi might get removed in future because of PDO? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 21, 2013 Share Posted August 21, 2013 I doubt any database-specific extension will be completely removed. It might happen in 10 years or so, but I don't see any plans to do that. The mysql extension hasn't even been removed yet, it's been deprecated since 2004 though. Link to comment Share on other sites More sharing options...
Mudsaf Posted August 21, 2013 Author Share Posted August 21, 2013 Well another question, do you really see difference between PDO queries & MySQLi queries? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 21, 2013 Share Posted August 21, 2013 If you're writing queries for PDO then you should try and make yourself aware of which features are only supported by MySQL, and avoid using those features. Try to stick to standard SQL that doesn't use any database-specific functions or features. If you can do that then your application will be portable across database systems. You may lose some performance. The tradeoff with using something like mysqli is that you can specifically target MySQL and therefore optimize your queries specifically for it. In that case you sacrifice portability though. Link to comment Share on other sites More sharing options...
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