djh101
07-17-2011, 01:28 AM
for($i=0; $utopicArray=mysql_fetch_assoc($utopicQuery) && $i<10; $i++){
echo '<li><a href="/?utopic='.$utopicArray['id'].'>'.$utopicArray['topic'].'</a></li>\n';
}
I want to echo the content of the array but only for 10 rows. The problem is that the $utopic[] variables don't output anything with && $i<10 in the statement. Why is this and how might I go about fixing it?
echo '<li><a href="/?utopic='.$utopicArray['id'].'>'.$utopicArray['topic'].'</a></li>\n';
}
I want to echo the content of the array but only for 10 rows. The problem is that the $utopic[] variables don't output anything with && $i<10 in the statement. Why is this and how might I go about fixing it?