RE: [PHP] array empty after use
> When an array is 'used' with something like do while I can't > re-access it later in the page. Arrays have a pointer that steps through the array as you 'use' it. Once you reach the end you'll have to reset that pointer before you can step through the array again. See the manual section on arrays for ways to do this. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array empty after use
when you loop through a mysql result set you move the pointer up one place. you need to use the mysql_data_seek($results, 0); to reset the pointer Jim Lucas - Original Message - From: "Web" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Tuesday, May 21, 2002 2:47 AM Subject: [PHP] array empty after use > Hi there. > > When an array is 'used' with something like do while I can't re-access it > later in the page. It is as if the array gets used up and doesn't exist. > The array is from a select statement using myself. I have inserted a > duplicate array with a different name to get around this but figure there > must be a simpler way. > > Any ideas please? > > Thanks > Kevin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array empty after use
Hi You just need to reset the array pointer with reset($array_name) Tom At 07:47 PM 21/05/2002, Web wrote: >Hi there. > >When an array is 'used' with something like do while I can't re-access it >later in the page. It is as if the array gets used up and doesn't exist. >The array is from a select statement using myself. I have inserted a >duplicate array with a different name to get around this but figure there >must be a simpler way. > >Any ideas please? > >Thanks >Kevin > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php