laflair13 Posted March 4, 2015 Share Posted March 4, 2015 This is for my own knowledge. I was looking into switching my site from mysql to mysqli because other say it is being depreciated with php 7. Well my question is, why is there such a sudden urge for it? I am on hostgator and they dont see in the near future when they (if they do) switch to the new php 7. They are still on php 5.5 Just curious on why everyone keeps saying that we all should switch to MySQLi or PDO like right now. Would like other thoughts and opinons on this. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/295100-whats-the-big-deal-on-converting-to-mysqli/ Share on other sites More sharing options...
Barand Posted March 4, 2015 Share Posted March 4, 2015 You don't have to change now, you can leave it until the functions actually disappear. But by then you will have much more to to change and no time to do it. The choice is yours. Quote Link to comment https://forums.phpfreaks.com/topic/295100-whats-the-big-deal-on-converting-to-mysqli/#findComment-1507527 Share on other sites More sharing options...
laflair13 Posted March 4, 2015 Author Share Posted March 4, 2015 (edited) I understand it is going to happen eventually, but I dont understand why everyone is acting like it is going to be very soon. Like I said, I was just curious for my own knowledge. Edited March 4, 2015 by laflair13 Quote Link to comment https://forums.phpfreaks.com/topic/295100-whats-the-big-deal-on-converting-to-mysqli/#findComment-1507530 Share on other sites More sharing options...
kicken Posted March 4, 2015 Share Posted March 4, 2015 it is being depreciated with php 7 That's not quite right. The old mysql extension is already deprecated (as of 5.5.0). In the next major version of PHP it is likely to be removed entirely meaning you (or your host) would have to specifically enable it rather than it being "standard". The newer API's such as Mysqli or PDO are being actively maintained and also provide more advanced/useful features such as prepared statements, bound parameters, transactions, etc. The mysql extension on the other hand currently would receive only major security fixes, and probably soon not even that. There is a page in the manual describing the different APIs that you should read if you want to know more. It's in your best interest to convert to the newer API's now while you have time to plan, implement, and test the changes. Eventually you'll get an email from your host along the lines of "We are upgrading PHP next week. The Mysql extension is no longer and any scripts relying on it will no longer function." If you haven't already upgraded your stuff by the time that email comes then you'll suddenly be in rush mode to either 1) Update your stuff like you should have already done or 2) Move to another host that will still support the extension. All that said, even a new release of PHP were out tomorrow that excluded the extension, you're probably at least 3 years away from a host dropping support. Most hosts will continue to support it for a while because not doing so would be bad for business. Hosts already support multiple versions of PHP so keeping 5.5/5.6 around for mysql support wouldn't be a big deal. Essentially the threat of the mysql extension going away is not why you should be updating. You should be updating because the extension is old, effectively abandoned, and lacks support for what are considered critical features for modern applications. Quote Link to comment https://forums.phpfreaks.com/topic/295100-whats-the-big-deal-on-converting-to-mysqli/#findComment-1507560 Share on other sites More sharing options...
laflair13 Posted March 4, 2015 Author Share Posted March 4, 2015 Appreciate it. I was just wondering why I seen people always saying we should convert to MySQLi or PDO. Thanks for the explination. Quote Link to comment https://forums.phpfreaks.com/topic/295100-whats-the-big-deal-on-converting-to-mysqli/#findComment-1507564 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.