Reply to Re: how to clear an array

Your name:

Reply:


Posted by Sentinel on 09/28/70 11:28

Stefan Rybacki 03.10.2005 17:36:14 <3qd1ffFecglaU1@individual.net>
stefan.rybacki@gmx.net alt.php Stefan

> 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

but in second pass query delivers only 3 columns...

--
Will work for bandwidth!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация