Code: Select all
//Create new db object
$db = new Db();
//Query
$qr_changelog = $db->query("
SELECT MAX(log_datetime) FROM ca_change_log
");
//Fetch result
$last_change = $qr_changelog->get('log_datetime');
//Print result
echo "Last Change:" . $last_change;
Ich habe es auch mit mysqli versucht:
Code: Select all
$db1 = new mysqli('localhost', 'user', 'passwd', 'db');
if ($db1->connect_errno > 0) {
die('Unable to connect to database [' . $db1->connect_error . ']');
}
$qr_changelog = $db1->query("
SELECT MAX(log_datetime) FROM ca_change_log");
while ($row = $qr_changelog->fetch_assoc()) {
echo $row['log_datetime'] . '
';
}
Mobile version