Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-05-2013, 09:22 PM   PM User | #1
ste.richards
New to the CF scene

 
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
ste.richards is an unknown quantity at this point
Why is mysql_query getting deprecated?

Google can't seem to answer this one.....
ste.richards is offline   Reply With Quote
Old 02-05-2013, 10:14 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
The entire mysql library is obsolescent. I'm surprised they kept it around this long.
The mysql library does not support many of the new functions available in the mysql dbms such as prepared statements. This functionality was added into the mysqli library which is simply the improved version. It also fixes little annoyances that the old mysql carried around such as improper return results and the auto global of the established connection.
So in short, good riddance; I for one won't shed a tear when its finally removed.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 02-06-2013, 01:25 AM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,530
Thanks: 0
Thanked 503 Times in 494 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Getting rid of it will plug some of the security holes associated with its use.

Rewriting your code to make use of the new code that mysqli_ and pdo support that mysql_ didn't will get rig of additional security holes.

Also the mysql_ interface was procedural only whereas PHP is an object oriented language and the other two interfaces can be used via objects.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 02-06-2013, 11:18 AM   PM User | #4
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,191
Thanks: 217
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
What surprises me is that it seems that until recently when we starting talking about this on this forum (and when Fou-Lu put this on his signature) and i have shared some of this on my other forum posts, on personal blogs, and also on other forums. Many people seemed to have no clue this was happening and now they are freaking out.

I have seen questions like, what about wordpress and what about this and that, thinking that they will be left hanging.

PHP 5.5 is just now in Alpha, my thought is that i will not be released for awhile, i am thinking inside of 2 years. That gives me time to start this and do this at my own pace rather than crunch at the end.

And 2 years goes by fast in this industry, by the time you convert your scripts, update your downloads and websites and forums and in the mean time still do what you do to make a living, 2 years will be here quick. That is the reason i am starting now.

And actually its not that bad of a conversion once you get the hang of it, i just wrapped up my second script conversion and a couple things i need to do but it was not that bad. But i still have my huge script to go and so we will see how positive i am then...lol

Just dont panic people is all im saying, the major scripts out there im sure are already planning for this and the world is not going to end because mysql library does...

And i totally agree with what was said above, this is a perfect opportunity to improve your scripts above and beyond the conversion it self.
durangod is offline   Reply With Quote
Old 02-06-2013, 03:20 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by felgall View Post
Also the mysql_ interface was procedural only whereas PHP is an object oriented language and the other two interfaces can be used via objects.
This is incorrect; PHP is natively a procedural language. OO was fit together in 4. . .2.0 I think it was. And by "fit", I mean they used a sledgehammer to force them puzzle pieces together
5.0 took a major overhaul to the engine to allow (more) correct OO concepts. It is still procedural though, but the OO side of it is getting a lot better.

Quote:
Originally Posted by durangod View Post
What surprises me is that it seems that until recently when we starting talking about this on this forum (and when Fou-Lu put this on his signature) and i have shared some of this on my other forum posts, on personal blogs, and also on other forums. Many people seemed to have no clue this was happening and now they are freaking out.

I have seen questions like, what about wordpress and what about this and that, thinking that they will be left hanging.

PHP 5.5 is just now in Alpha, my thought is that i will not be released for awhile, i am thinking inside of 2 years. That gives me time to start this and do this at my own pace rather than crunch at the end.

And 2 years goes by fast in this industry, by the time you convert your scripts, update your downloads and websites and forums and in the mean time still do what you do to make a living, 2 years will be here quick. That is the reason i am starting now.

And actually its not that bad of a conversion once you get the hang of it, i just wrapped up my second script conversion and a couple things i need to do but it was not that bad. But i still have my huge script to go and so we will see how positive i am then...lol

Just dont panic people is all im saying, the major scripts out there im sure are already planning for this and the world is not going to end because mysql library does...

And i totally agree with what was said above, this is a perfect opportunity to improve your scripts above and beyond the conversion it self.
People shouldn't panic, not yet. MySQL isn't a small part of PHP, its a huge part. I'd expect that we'll go until *at least* 5.8 before it's actually removed, and IMO not until 6.0.
Compare it to something like magic_quotes or register_globals. register_globals was officially deprecated in 5.3 and removed in 5.4. That was a short turn around. But register_globals by default has been disabled since 4.2, so the reliance on it should have been minimal to start with. magic_quotes was simply a bad idea to start with, and should have been dealt with years ago. Unlike these two examples, thousands upon thousands of scripts rely on the mysql library, so they won't be so quick to yank it (even if it was soft deprecated since 5.0).
5.5.0 won't take long to roll out; I'd expect within the next few months. But I figure there's at least 2 years before you need to actually worry about not having mysql library available.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:37 AM.


Advertisement
Log in to turn off these ads.