Jump to content

how to number mysql results


MDanz

Recommended Posts

Try this, this way works for me

 

$query = "SELECT * FROM  Cards";

$result = mysql_query($query)
or die("Query failed: " . mysql_error());


while ($row = mysql_fetch_assoc($result))
{


//Prints the id numbers in the table. The id numbers go from 1 and forever
//You will need to set a primary key and it will be the primary id number in your mysql table

echo $row['id'];
//Prints row numbers
}



Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.