So I had my website working but the hoster forced me to migrate, so I had to backup all I had and change it to the new host. The code was working but since I changed I cant get this code working. The connection to the database seems fine.
The code had to be changed from mysql to mysqli
All I get from mysqli_num_rows or mysqli_query is blank.
I checked the encoding and its UTF-8.
The query works fine on phpmyadmin
Since I only have ftp access to the publish folder Im not sure what options i have to find the problem.
$link = mysqli_connect($hostname,$username, $password) OR DIE ("Unable to connect to database! Please try again later." . mysqli_connect_error());
mysqli_set_charset($link, "utf8");
mysqli_select_db($dbname, $link);
$result = mysqli_query($link, "SELECT * FROM $usertable ORDER BY Date DESC");
//echo "result:" . $result; returns blank
echo "results:" . mysqli_num_rows($result); returns blank