Code:
$id = mysql_real_escape_string($_GET['username']);
$hwid = mysql_real_escape_string($_GET['hwid']);
 
$query = "SELECT * FROM `user` WHERE `username` ='{$id}'";

$result = mysql_query($query);

echo "<table border='1'>
<tr>
<th>Group</th>
<th>Hwid</th>
</tr>";
while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['usergroupid'] . "</td>";
  echo "<td>" . $row['hwid'] . "</td>";
  echo "</tr>";
  }
echo "</table>";


if($result['hwid'] == "" or !isset($result['hwid'])) {
mysql_query("UPDATE user SET hwid='{$hwid}' WHERE `username` ='{$id}'");
}

mysql_close();
?>
This is part of a mysql code I am using.
For some reason the php skips the "if($result['hwid'] == "" or !isset($result['hwid'])) {"
It basicly skips that part and just goes on the on to whats under if. Even if the field is not blank it will change the field. I want it so that if the field has something already in it that it will just leave it alone.