11

Which is the latest version PHP version, who support mysql_connect()?

I've want to upgrade my PHP version. I've read, that mysql_connect() are deprecated. In all Projects I've use the old mysql_connect(). Can I update to PHP 5.6.5 or is the command in this version removed already?

Uses somebody PHP 5.6.5 with mysql_connect()?

Problem is, that I can't change sooo much Projects in this short time and could only update to the highest version, which support mysql_connect().

Best regards and many thanks!

7
  • 3
    "Is mysql_connect() usable in PHP 5.6.5" - A: No'ish, and error reporting will tell you. Use mysqli_ or PDO. If you get a warning, then you'll have no choice but to switch. Commented Jan 28, 2015 at 21:00
  • 2
    It's still available in 5.6.x, with depreciation notice. In future versions it's likely to become an external PECL module. Commented Jan 28, 2015 at 21:02
  • To answer the question at hand, there is a piece of code I remember seeing on Stack/web that will detect whether the functions are deprecated and if so, use the respective API. You just need to look for it. Commented Jan 28, 2015 at 21:13
  • Sorry! I don't find the same question with answer. I've read, that I'll get a deprecation notice. But if I get a notice, then I could use the function?! In future I will/must use the mysqli, but I must take an update now and must use the php version, where mysql_connect() are usuable (notices I can deactivate). But I can't change sooo many codelines to mysqli_* in this short time.... Commented Jan 28, 2015 at 22:40
  • 1
    @developerwjk correct! all new projects uses an own sql class. but the old projects are coded hard and I can't update the server and tomorrow I must change 100 projects with a few thousends codelines... - it isn't possible. therefore I asked in which version the mysql_connect() isn't usable anymore... :-) Commented Jan 28, 2015 at 22:58

1 Answer 1

8

http://php.net/manual/en/function.mysql-connect.php

5.5.0 This function will generate an E_DEPRECATED error.

don't try to use any mysql_* functions as they are deprecated and dangerous. See mysqli_ functions instead.

Sign up to request clarification or add additional context in comments.

7 Comments

Very well formatted "comment". Wish I could do that in one.
PDO is preferable to MySQLi IMHO.
There is no need to be sarcastic and mean. I was writing this comment the same time as you were.
Questions like these shouldn't have answers, IMHO. They're all over Stack and the web. I mean come on, really. Plus, PHP 5.6 - mysql_ to be deleted in future releases. 5.6 IS a future release.
@developerwjk Therefore not "answering" the real question asked.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.