![]() |
|
|
#1 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
Why can you only use fetch_array only once?
Here's some code. Why can't you do this while statement twice?
PHP Code:
Unfortunately, I ran a test and the second whil statement is blank. Here's the test: PHP Code:
__________________
** Most misspellings intentional to combat spaham filterz** |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Sep 2006
Posts: 4
|
Re: Why can you only use fetch_array only once?
mysql_fetch_array() returns an array that corresponds to the fetched row and moves the internal data pointer ahead and leaves it there. So repeating the process starts after your values and thus returns nothing.
It does seem odd though. Obviously you never need to repeat it - I assume you were just curious. I'd never spotted it in years of using php! |
|
|
|
|
|
#3 |
|
Administrator
Join Date: Jun 2004
Posts: 383
|
Re: Why can you only use fetch_array only once?
I've come across this requirement and found a way to reset the pointer. Can't remember the code offhand but there is a way to do it.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|