MySQL Error

Hey all,

just got a little prob which is absolutely buggin me i can’t find this simple error…i’m going blind because i tested it it worked fine…couple hours later tested again (nothing changed) and i get this error now:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in … on line 12

here is the php code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test</title>
</head>
<?php require_once('Connections/connect.php'); ?>
<?php
$sql = mysql_query("SELECT * FROM my_table ORDER BY RAND() LIMIT 20");
echo '<table width="571" height="248" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
    <tr>';
for($x=0; $r = mysql_fetch_assoc($sql); $x++){
    if($x == 4){
        echo '    </tr><tr>';
        $x=0;
    }

    echo '        <td width="137" align="center" class="style1">'.$r['words'].'</td>'."
";
}
echo '    </tr>
</table>';
?>

<body>

</body>
</html>

Cheers in advance :bounce: