I am trying to develop a custom module; so far it works as it should. The only problem is I can't seem to get the MAC address to remain unchanged on update. It keeps getting the device ID number instead of the MAC field. How do I avoid the MAC address is changed?
function device_delete_request($uid = null, $macaddress, $device_id = null) {
db_update('argon_user_stuff')
->fields(array(
'id' => $device_id,
'uid' => $uid,
'macaddress' => $macaddress,
'deletedmacaddress' => $macaddress,
'updated' => REQUEST_TIME,
'deleted' => REQUEST_TIME,
'active' => 0
))
->condition('uid', $uid, '=')
->condition('id', $device_id, '=')
->execute();
// Set the message and return to the user's profile page
drupal_set_message('Device deleted');
return drupal_goto("user/{$uid}/devices");
}