tmp: diagnostic script

This commit is contained in:
2026-02-28 00:53:13 +01:00
parent 28de4e88b7
commit 08bd6d23c9

31
_diag_licenses.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
require_once 'config.php';
require_once 'libraries/medoo/medoo.php';
$mdb = new medoo([
'database_type' => 'mysql',
'database_name' => $database['name'],
'server' => $database['host'],
'username' => $database['user'],
'password' => $database['password'],
'charset' => 'utf8'
]);
$count = $mdb->count('pp_update_licenses', []);
echo "COUNT: $count\n";
$rows = $mdb->select('pp_update_licenses', '*', ['ORDER' => ['domain' => 'ASC']]);
echo "select() result type: " . gettype($rows) . "\n";
if ($rows === false) {
echo "ERROR: " . json_encode($mdb->error()) . "\n";
echo "LAST QUERY: " . $mdb->last() . "\n";
} else {
echo "Rows: " . count($rows) . "\n";
if (!empty($rows)) {
echo "First row: " . json_encode($rows[0]) . "\n";
}
}
// Check table structure
$cols = $mdb->query("DESCRIBE pp_update_licenses")->fetchAll(PDO::FETCH_ASSOC);
echo "\nColumns: " . implode(', ', array_column($cols, 'Field')) . "\n";