Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
It should be. But the people behind Zend are very conservative. – Andrea Sep 12 '12 at 14:27
up vote 8 down vote accepted

See 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


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.