I am looking for a function to get the speciic number of the mySQL result. I am using a while
function.
$querycheckmain = "SELECT * FROM `table` WHERE `Main`='".$main."'";
$result=mysql_query($querycheckmain) or die("Errore check main: ".mysql_error());
$count = mysql_num_rows($result);
$count
gives me the TOTAL results. What I want is to echo
the specific number of the result during the mysql while
.
So if we have 3 results, in order:
Mainaccount Paul = result number 1
Mainaccount George = result number 2
Mainaccount Clare = result number 3
Is this possible?
I do not need the total result, I need the number of the specific result given during the mysql while.
Thanks for your help.
$result=mysql_query($querycheckmain) or die("Errore check main: ".mysql_error());
$rowNumber = 0;
while ($row = mysql_fetch_row($result)) {
$rowNumber++;
// do what you want to do with the $row data here
// $rowNumber contains the row number
}