The following code works fine when i remove the && $f<4
, but with it in, it doesn't work.
PHP:
$titles=array();
$f=0;
while ($row=mysql_fetch_assoc($query) && $f<4){ //this line doesn't work
$titles[]=$row['questiontitle'];
echo "<div class='questionPreview'>$titles[$f]</div>";
$f++;
}