Jump to content

Q> How to find the position of the record on the database record???


Recommended Posts

you could do a query and output like this

$result = mysql_query("SELECT Animal FROM animals") or die(mysql_error());
for($i = 1;$row = mysql_fetch_array($result)!=null;$i++){
     echo $row['Animal'] . " is at " . $i;
}

this uses a for instead of a while so you don't need a ID key although i would recommend putting one in

 

Scott.

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.