Reply to Re: duplicating mysql_query result

Your name:

Reply:


Posted by Ciaran on 03/27/07 14:54

On Mar 27, 3:42 pm, Kim André Akerø <kiman...@NOSPAMbetadome.com>
wrote:
> Ciaran wrote:
> > 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.
>
> Sure thing, just use the mysql_data_seek() function between the while()
> loops, like this:
>
> while($rowdata = mysql_fetch_array($result)) {
> // do something}
>
> mysql_data_seek($result, 0);
> while($rowdata = mysql_fetch_array($result)) {
> // do something entirely different
>
> }

Fantastic! Thanks a lot!
Ciarán

[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

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