Can anyone tell me why the following isn't working? The query works fine but for some reason the index is still set to 1???
$query = "SELECT * FROM employee ORDER BY LastName";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
////if user coming in from FindContact page goto required record
if (isset($First) && isset($Last))
{
for ($i=1; $i<$num_results; $i++)
{
$row = mysql_fetch_array($result);
echo "$i "; echo ($row["FirstName"]); echo " ";echo ($row["LastName"]); echo "<br/>";
$First = strtoupper($First);
$Last = strtoupper($Last);
if (($row->FirstName==$First) && ($row->LastName==$Last))
{
$index=$i;
}
}
}
$FirstName = addslashes($FirstName);
$LastName = addslashes($LastName);
//Set row number to one if no record present
//global index;
if (!isset($index))
{
$index=1;
}