I am fetching data from MySQL database... I want to check index of each row... e.g
while($row=mysql_fetch_array($result)
{
i want index of $row in each row... (current Index).
}
Please Help me. Thanks
I am fetching data from MySQL database... I want to check index of each row... e.g
Please Help me. Thanks |
||||
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
If you want the index from the database:
Or, if you want to count the number of items based on the output:
That's what I understood from your question.. |
|||
|
If I understood you correctly you want something like this
|
|||
|
$row is not a member of any array. So, it has no index at all. |
|||
|
$i = 0;
before the loop and$i++;
in the end of the loop body – zerkms Sep 25 '11 at 11:55