This snippet was running perfectly on localhost, but after I uploaded the file containing this snippet on a webserver, the script does generate an error, or even displaying none (no results).
#selects all data from table and displays it in textfields. If failed, it will display the error
$sql = "SELECT * from tblquotes ORDER BY Rand() LIMIT 1";
$result = mysql_query($sql,$connection);
if($result = mysql_query($sql ,$connection)) {
$num = mysql_numrows($result);
$count =0;
while ($count < $num){
$q1 = mysql_result($result,$count,"quote");
$q2 = mysql_result($result,$count,"author");
$count++;
}
} else{
echo "ERROR: ".mysql_error();
}
what seems to be the problem? Need help...
I'm running on PHP 4.4.4 on Localhost and PHP 5.2.9 on the webserver.
Mysql 4/5 on Localhost and Mysql 4.1.22 on the webserver