alin19 Posted April 1, 2008 Share Posted April 1, 2008 i have 13 records for each line, but on count it outputs 26, am 13 undifined index, what is the problem here? while ($query_afis_conturi=mysql_fetch_array($query_exec_conturi)) { $inregistrari[]=$query_afis_conturi; } if (isset ($inregistrari)) { $nr=count($inregistrari[0]); foreach ($inregistrari as $rand) $nr=count($rand); for ($i=0;$i<$nr;$i++) echo " ".$rand[$i]." "; $i=0; } echo $nr; //26 Link to comment https://forums.phpfreaks.com/topic/98962-php-error/ Share on other sites More sharing options...
kenrbnsn Posted April 1, 2008 Share Posted April 1, 2008 The function mysql_fetch_array() returns two entries per row, one numerically indexed and one associatively indexed. You probably want to use the function mysql_fetch_assoc(). Ken Link to comment https://forums.phpfreaks.com/topic/98962-php-error/#findComment-506365 Share on other sites More sharing options...
alin19 Posted April 1, 2008 Author Share Posted April 1, 2008 10x Link to comment https://forums.phpfreaks.com/topic/98962-php-error/#findComment-506405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.