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:
+1
-1
@@ -7,7 +7,7 @@ $link = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' .
|
||||
mysqli_select_db($link, 'pqs') or die('Could not select database');
|
||||
// get current pods
|
||||
$query = 'SELECT * FROM pqs_pods';
|
||||
$result = mysqli_query($link, $query) or die('Query failed: ' . mysql_error());
|
||||
$result = mysqli_query($link, $query) or die('Query failed: ' . mysqli_error($link));
|
||||
$line = mysqli_fetch_array($result);
|
||||
$pod01 = $line[0];
|
||||
$pod02 = $line[1];
|
||||
|
||||
Reference in New Issue
Block a user