I need to fetch the highest value from a mysql db column. It's a timestamp. Using mysql MAX function it's not working, bellow you can see the code:

```
//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;

```

If I run the query without MAX function it works (but obviously returns all values). If I run the query from mysql server console it works. Apache log shows no errors.

I also tried with mysqli:

```
$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'] . '<br />';
}

```

Any ideas?