I don't know what's wrong with this code. I think this code should work. I'm about to store number of each query in array
$antecedent=array();
for($i=0;$i<=$index;$i++){
if(isset($period[$i])|| isset($gpa[$i]) || isset($antecedent[$i])){
echo $period[$i]." ";
echo $gpa[$i]."<br/>";
$queryAntecedent=mysql_query("SELECT * FROM mytable WHERE study_period='$period[$i]' AND ipk='$gpa[$i]'") or die (mysql_error());
$antecedent[$i]=mysql_num_rows($queryAntecedent);
}//endif
}//endfor
print_r ($antecedent);
when i print_r $antecedent, its output is all zero for every element. i've tried to run the query in phpmyadmin and the result is not zero..i got some rows of result.
i've echo $period[$i] and $gpa[$i], it printed the results.So, i think there's no problem with the the values of those two array.
So, why can't i get the total rows of query? why all element in antecedent array only gives me 0 number?Please help!
Thank you :)