Zac,
what is your indicator of which row it is?
If you have aprimary key for each row, why don't  you just use that?
You cant really determine the position of a row if you haven't determined
the criteria that fixes the position, right?
So, you just decide wether you will sort it alphabetically or according to a
row index, then go ahead and do it...

If, on the other hand, you mean you want to return the position WITHIN the
selection you have gotten, you could just push the records onto an array one
by one. Then the array index for each row gives away the position of the row
(-1, actually).

Example:
--------------------------------------------
$rows = array();
$query = "select * from blabla";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
 array_push($rows, $row);
 }

// - now you have it all in an array variable in php - accessible like this:

foreach($rows as $idx => $row)
 echo "$idx:".$row["field_1"]." - ".$row["field_2"]." -
".$row["etc"]."<BR>\n";
...
--------------------------------------------


I'm not sure wether I grasp what your question really is, but perhaps this
helped some?

Good luck,
    Eivind <:-)



----- Original Message -----
From: "Zac Hillier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 9:58 AM
Subject: mysql row position


> Hi
>
> I'm looking for a php function that will return the position of the
pointer
> in a mysql recordset.
>
> I found mysql_data_seek, but this appears to only move the pointer, I need
> to get the equivalent row number for the pointer position before moving
it,
> then return to the same position.
>
> Can anyone help?
>
> Thanks
>
> Zac
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to