ext/mysql deprecated in PHP 5.5.0

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Well, folks, PHP 5.5.0 Alpha 6 has been released, and ext/mysql is deprecated. Don't say I didn't warn you. If you are still developing (or using) scripts that use the mysql_xxx methods (as opposed to mysqli_xxx or PDO), you will soon need to turn off warnings in your scripts. The mysql_xxx methods will stop working altogether, even with warnings off, in some future version.

If you haven't switched yet, now is the time. And if you're just pasting teh codez from the web (or an old book), do try to pay attention—if the code you're copying has mysql_connect, etc., in it, it's old and bad and you should look somewhere else.
 
Last edited:

learning_brain

New Member
Messages
206
Reaction score
1
Points
0
Thanks for the heads up...

Do you have some useful links for tuts on mysqli or PDO methods?

I wonder how many CMS based sites will suddenly crash when their hosts upgrade... on the sorrows of CMS :)
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
There are several good links for PDO in the previous thread, especially in misson's response to miguelkp. I've never looked at mysqli seriously, but it can be used almost as if it were a drop-in replacement for mysql with little changing in the code beyond the extra letter "i" in many cases. There is a good overview of mysqli over at DatabaseJournal.com for anyone already familiar with ext/mysql and SQL in general.

As for the CMSs and so forth, as long as people keep their scripts up to date (and the scripts are being maintained), it shouldn't be a problem. Well, it shouldn't be a problem if the script's writer didn't do some weird, home-rolled manual escaping in his mysql-based code, at least. The database structures and schemas won't change, just the code one uses to interact with the DBs. (And since old CMSs and forums are easy targets for exploits, we've actually started the process of policing updates here; I'm sure other hosts who are tired of cleaning up their shared hosting platforms after yet another expected exploit ruins everybody's day are doing pretty much the same thing.)
 
Last edited:

learning_brain

New Member
Messages
206
Reaction score
1
Points
0
Thanks. I did read the sticky as well, but I thought a repeat would be useful for those reading this post.

I guess mysqli will be the intermediate solution...

Richard
 
Top