Hi Everyone -
I have recently upgraded my hosting enviroment and the php version has changed to Current PHP version: 5.6.27
Now a number of queries do not work as they did before.

The below query has stopped working, Any ideas how I can update the query so it works again please.

    //Select countries from country table
    $result_country = mysql_query("select Country from countries order by Country Desc ");

Thanks in advance

Recommended Answers

All 3 Replies

The current latest stable PHP version is 7.* from which ext/mysqlwas removed.

If you are using PHP 5.6 then the query should still work, as ext/mysql is only deprecated. Can you share the error code you got from the above?

What cereal said. Use mysqli instead in any case. The mysql interface has been deprecated for a LONG time!

Member Avatar for diafol

There is no way to see what the issue is from that paltry line of code. As mentioned mysql_*functions should still work in 5.6, but why you're still using them is not clear.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.