Posted by Stefan Rybacki on 10/03/05 18:36
Sentinel wrote:
> Stefan Rybacki 03.10.2005 11:29:16 <3qcbvcFe3f44U2@individual.net>
> stefan.rybacki@gmx.net alt.php Stefan
>
>
>>Sentinel wrote:
>>
>>>I have an array (that is filled from mysql) first its count is 6
>>>and it has 6 items in it, second time its count is 6 but there are
>>>only 3 items in it... why does count() return 6 both times?
>>>
>>>how do i empty/clear the array?
>>>
>>
>>clear an array like this $array=array();
>>
>>Well it would help to see some of your source code that shows the
>>behaviour above.
>>
>>Regards
>>Stefan
>
>
> it is a loop: (i don't have it on this pc so here is it without the
> details)
>
> while (condition){
> $a = mysql_query("SELECT * FROM options WHERE
> optiongroup='".$arrayoptiongroup{'optiongroup_id'}."'");
> while ($arrayoptions = mysql_fetch_array($a, MYSQL_ASSOC)){
> do some stuff
> print count(arrayoptions); <--- this allways returns the same value
> as the first time
> }
Thats right, since the query delivered 6 columns? Think about it.
Regards
Stefan
[Back to original message]
|