MySQL Forums
Forum List  »  Newbie

Re: Getting (to) row number
Posted by: Claude Martin
Date: July 28, 2005 01:31AM

> There is no value that represents the actual row
> number. This is what I'd like a query to return.

there is no row number! it depends on the sorting anyway.
just use a variable that increments every time you fetch another row.
<?
$sql = mysql_query("SELECT * FROM sometable");
$rownr=0;
while($row=mysql_fetch_assoc($sql)) {
$rownr++;
...
}
?>

http://animalliberation.tk http://veganismus.ch
http://maqi.de http://tierrechtskochbuch.de

Options: ReplyQuote


Subject
Written By
Posted
July 27, 2005 11:27PM
Re: Getting (to) row number
July 28, 2005 01:31AM
July 28, 2005 01:29AM
November 25, 2008 05:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.