在使用数组获取所有信息时如何突出显示表行?

I'm fetching all rows in mysql database with mysql_fetch_array() then showing them in table.

while($row = mysql_fetch_array( $data )) { 
  echo "<td>" . $row['name']."</td>";
}

In this case, if user updates a record on table with my php form, I want to highlight that table row. (changing background color is enough.) How can I do that? Or can I intervent in while loop for only one record?

Try something like this to compare your data in the form (that part is $_POST['id'] - change that with your code) where the user sent his updates with the current row data (I suppose you have something like an id in the sql row result) and change the style of the row.

while($row = mysql_fetch_array( $data )) { 
  $style = ($row['id'] == $_POST['id']) ? 'style="background-color: red;"' : '';
  echo "<td $style>" . $row['name']."</td>";
}

If you have insert at the top of the script then

//insert to mysql here
$id = mysql_insert_id($resource);
...
while($row = mysql_fetch_array( $data )) { 
  if ($id == $row['id']) {
    echo '<td style="color:red">' . $row['name'] . "</td>";
  } else {
    echo "<td>" . $row['name']."</td>";
  }
}