Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have been noticing for a long time on Stack Overflow that most users recommend to use PDO instead of mysql_*, because PDO is more secure than mysql_*. But my question is if websites which are already running with mysql_* will stops working? Or what exactly does "deprecating" mean here? So should we have never used mysql_*? From which PHP version is is deprecated?

share|improve this question
2  
It should be. But the people behind Zend are very conservative. –  Andrea Sep 12 '12 at 14:27

2 Answers 2

up vote 8 down vote accepted

See PHP.net page FAQ. It answers your question and gives migration advice.

Your code won't suddenly stop working unless when PHP remove the functionality, you upgrade your PHP version. The FAQ page advice recommends you write new code using one of the alternatives. If it's not a massive job, it could be worth considering switching.. that depends on your project though.

share|improve this answer

The websites written with mysql_* functions shall continue to work until PHP removes the functionality altogether. As of now, the functions are merely depreciated.

Deprecated means that those functions are no longer recommended, and are replaced with better functions. They may have no support either.

It's recommended to switch over to PDO mainly because of the security that it provides with injection based attacks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.