Re-point into first record

Re-point into first record

am 04.09.2007 07:26:46 von Anees

hi,
am using mysql_fetch_array() method to fetch all the record and list
it.
after finishing all the records fetched i need to Index the record
position into the beginning of the record set.

Does we have any other option to re point it to first record instead
of using mysql_query() method again

Regards
Anees

Re: Re-point into first record

am 04.09.2007 12:25:18 von Michael Fesser

..oO(Anees)

>am using mysql_fetch_array() method to fetch all the record and list
>it.
>after finishing all the records fetched i need to Index the record
>position into the beginning of the record set.
>
>Does we have any other option to re point it to first record instead
>of using mysql_query() method again

mysql_data_seek()

But if I would need the same record set multiple times, I would fetch it
into an array before I use it. Then you can reset and loop through as
often as you want, even select a particular record.

Micha

Re: Re-point into first record

am 04.09.2007 13:00:21 von Jerry Stuckle

Anees wrote:
> hi,
> am using mysql_fetch_array() method to fetch all the record and list
> it.
> after finishing all the records fetched i need to Index the record
> position into the beginning of the record set.
>
> Does we have any other option to re point it to first record instead
> of using mysql_query() method again
>
> Regards
> Anees
>

http://us3.php.net/manual/en/function.mysql-data-seek.php

Not the most intuitive name, I do admit.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================