Sloppy slow way:
<?PHP
$link = mysql_connect($dbhost, $dbuser, $dbpass);
$rowsquery = mysql_query("select * from yourtable order by someorderyoupick ASC");
$rowsgoneby = 0;
$numtotalrows = mysql_num_rows($rowsquery);
for ($cnt = 0; $cnt < $numtotalrows; $cnt++) {
$rowdata = mysql_fetch_array($rowsquery);
if (!in_array($searchfeildfromform, $rowdata)) {
$rowsgoneby++;
}
else {
echo "there were ".$rowsgoneby." rows until I found a match";
}
}
?>
Just a quick 1 minute answer. Hopefully you don't try to use it as is because I doubt it will work 🙂 I didn't check it at all. I only wanted to show you the road.
Also, I'm sure now that there is code in the post the people who have done this before and have a better way will swoop in and make me look foolish 😉 but hey, atleast you'll get your answer one way or another!