Help with this query?

$query = "SELECT * FROM leaderboard ORDER BY score DESC LIMIT 10";
$result = mysql_query($my_query);
$num = @mysql_num_rows( $result );
$i = 1;

while($line = @mysql_fetch_array($result)){
$name[$i] = $line['name'];
$score[$i] = $line['score'];
for ($i=1; $i<=$num;$i++){
$text = $results . "&name$i=" . $name[$i] . "&score$i=" . $score[$i];
echo $text;
//print (mysql_error());


when i test this query in mysql itself i get the results i am aiming for :D…YET when i test the script from the browser or through flash i get this error:

“query empty” why?? or what does this mean?

cheers peeps