Advertisement
eqeqwan21

Untitled

Mar 16th, 2025
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. if (isset($omsg['uContactor']) && is_array($omsg['uContactor'])) {
  2.                                     $mask = '';
  3.                                     foreach ($omsg['uContactor'] as $value) {
  4.                                         $mask .= ($value !== null) ? '1' : '0';
  5.                                     }
  6.                                     $sql_update = "UPDATE Devices SET Mask_Command = :device_mask WHERE id = :device_id";
  7.                                     try {
  8.                                         $stmt_update = $db->db->prepare($sql_update);
  9.                                         $stmt_update->execute([
  10.                                             ':device_mask' => $mask,
  11.                                             ':device_id'   => $ival['Devices_id']
  12.                                         ]);
  13.                                     } catch (Exception $e) {
  14.                                         error_log('Device update error: ' . $e->getMessage());
  15.                                     }
  16.                                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement