function updatefriendrequest(){
$temp=$_SESSION['info'];
$sql_friend="select * from friend_friend where friendid='$temp[auto_id]' and alert_message='yes'";
$result_friend=executeQuery($sql_friend);
while($line_friend=mysql_fetch_array($result_friend)){
$sql_friendupdate="update friend_friend set alert_message='no' where friendid='$temp[auto_id]' and autoid='$line_friend[autoid]'";
executeQuery($sql_friendupdate);
}
$temp='';
}
Here is my funtion above, is it better to do that, it checks to see if there is a record to update or better to do the way below where it just updates it, the way below will try to update it even if it does not exist, is that bad for a high traffic site?
$sql_friendupdate="update friend_friend set alert_message='no' where friendid='$temp[auto_id]'";
executeQuery($sql_friendupdate);