Complete port of all 163 API endpoints from Lucee/CFML to PHP 8.3. Shared helpers in api/helpers.php (DB, auth, request/response, security). PDO prepared statements throughout. Same JSON response shapes as CFML.
19 lines
536 B
PHP
19 lines
536 B
PHP
<?php
|
|
require_once __DIR__ . '/../helpers.php';
|
|
runAuth();
|
|
|
|
try {
|
|
$targetBusinessID = 44;
|
|
|
|
queryTimed("UPDATE Beacons SET BusinessID = ?", [$targetBusinessID]);
|
|
|
|
$qCount = queryOne("SELECT COUNT(*) AS cnt FROM Beacons WHERE BusinessID = ?", [$targetBusinessID]);
|
|
|
|
jsonResponse([
|
|
'OK' => true,
|
|
'MESSAGE' => "All beacons reassigned to BusinessID $targetBusinessID",
|
|
'COUNT' => (int) $qCount['cnt'],
|
|
]);
|
|
} catch (Exception $e) {
|
|
jsonResponse(['OK' => false, 'ERROR' => $e->getMessage()]);
|
|
}
|