The greater question: Why does irow order matter? What are you REALLY
trying to do?
==
In article 000701c1cb06$3b54f3b0$0101a8c0@nightengale,
[EMAIL PROTECTED] says...
Hello,
How can I get the number of the current row, something like this:
?
$sql = mysql_query(SELECT *
Rick,
I agree. opinionRow ids should be for internal database use. SQL frees
us from needing them. /opinion
Tyler, what order do you want these records returned in? That is what
goes into the ORDER BY clause. If, for example, it is alphabetical order
of NAME then use ORDER BY NAME. If it is
Tyler Longren wrote:
Hello,
How can I get the number of the current row, something like this:
?
$sql = mysql_query(SELECT * FROM table ORDER BY id DESC);
while ($row = mysql_fetch_array($sql)) {
$id = $row[id];
$name = $row[name];
print $current_row_number. $nameBr;
}
?
hmmm, I never thought of that. Thanks for the help. ;-)
Tyler
- Original Message -
From: michael kimsal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Tyler Longren [EMAIL PROTECTED]
Cc: PHP-General [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 9:57 PM
Subject: [PHP] Re: Get row number
In article 000701c1cb06$3b54f3b0$0101a8c0@nightengale,
[EMAIL PROTECTED] says...
Hello,
How can I get the number of the current row, something like this:
?
$sql = mysql_query(SELECT * FROM table ORDER BY id DESC);
while ($row = mysql_fetch_array($sql)) {
$id = $row[id];
$name
5 matches
Mail list logo