Posted by Sentinel on 10/13/78 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
i just realized...
what i need is rows...
while (array) {
if (first row) {do something}
do something else
if (last row) {do something else 2}
}
how do i findout when loop is at the first row and at the last row?
--
Will work for bandwidth!
[Back to original message]
|