Upgraded word press version to latest version 4.3.1 and custom queries
are not working into word press Upgrade. It’s give message like “no
database selected”.
All the database details in wp-config.php are correct and working fine before up grade. following custom query which is gives message to me after upgrading to 4.3.1 latest version.
Please help to fixing it.
$sql = "select Country_Id, Country_Code,Country_Name from mopt_country where IsActive=1 order by Country_Name ASC";
$result = mysql_query($sql) or die(mysql_error());
Can you use mysqli which is safer and not deprecated like mysql function?
I had some connection problem when I used the
mysql
function. Dunno why honestly.here is a sample code
Post your results after it.
Also, as I have already said in my comments, a no db problem is a no db problem. Double check your creditians (user, pass, dbname).
It seems logic after the upgrade, WP add any extra column or delete any column, but it doesn’t logic to change your db name.
Edited:
Probably, this is the reason that you have that error:
check that link: Why shouldn’t I use mysql_* functions in PHP?
As you can see, Quentin says that :