Home > Archive > PHP Programming > March 2007 > duplicating mysql_query result
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
duplicating mysql_query result
|
|
| Ciaran 2007-03-27, 7:00 pm |
| Hi is there a way of duplicating the same mysql_query resource result
or is there a way to stop it from being cleared once it is no longer
needed? I need to run a ... while(mysql_fetch_array($result)) ... loop
twice and I want to avoid re-runnuing the query.
Cheers,
Ciar=E1n
| |
|
|
| Ciaran 2007-03-27, 7:00 pm |
| On Mar 27, 3:42 pm, Kim Andr=E9 Aker=F8 <kiman...@NOSPAMbetadome.com>
wrote:
> Ciaran wrote:
>
> Sure thing, just use the mysql_data_s () function between the while()
> loops, like this:
>
> while($rowdata =3D mysql_fetch_array($result)) {
> // do something}
>
> mysql_data_s ($result, 0);
> while($rowdata =3D mysql_fetch_array($result)) {
> // do something entirely different
>
> }
Fantastic! Thanks a lot!
Ciar=E1n
|
|
|
|
|