Hi kath,
This error occurs whenever there is an error in your query. Better solution is just echo your query then copy the query and run it in the query editor or you can use phpmyadmin.
echo $sql = "select * from q_multchoice where refid = $refid and chapter = $chapters and userid = ".$_SESSION["uid"]." limit $offset, $ppp";
what you have used below is fine.
if (mysql_num_rows($res) !=0)
{
…
}