Following code gives no error message, there is absolute no output. I have tried to run query in phpmyadmin, it is working perfectly.
<?php
$db = mysql_connect(178.62.64.68, user1254, XXXX) or die('Could not connect: ' . mysql_error());
mysql_select_db(db001) or die('Could not select database');
$query = "SELECT ID, DATE, SCORE FROM table001 ORDER by SCORE asc LIMIT 10";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$result_array = array();
while($row = mysql_fetch_array($result))
{
$result_array[] = array(
'id' => $row['ID'],
'score' => $row['SCORE'],
'date' => $row['DATE']
);
}
echo json_encode($result_array);
?>