Add centralized DB helper; fix legacy mysql_error() landmines

- includes/db.php: shared mysqli connection + parameterized query helpers
  (pqs_db/pqs_exec/pqs_rows/pqs_row/pqs_val), targets PHP 7.4+.
- Replace 11 mysql_error() calls (undefined function on PHP 7+) with
  mysqli_error($link) / mysqli_connect_error() across getFSgame, getFSplayers,
  config, callsign, console. Only affected already-failed error paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-01 12:51:13 -05:00
co-authored by Claude Opus 4.8
parent 7d643dde17
commit 061291c951
6 changed files with 82 additions and 11 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ mysqli_select_db($link, 'pqs') or die('Could not select database');
// get current pods
$query = 'SELECT * FROM pqs_gameconfig';
$result = mysqli_query($link, $query) or die('Query failed 12: ' . mysql_error());
$result = mysqli_query($link, $query) or die('Query failed 12: ' . mysqli_error($link));
$line = mysqli_fetch_array($result);
$visibility = $line[7];