I have this:
$query = "SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'my_db_name' AND TABLE_NAME = 'my_table_name'";
$result = $modx->query($query);
if ( !is_object($result) )
{
// report Error
print "Error in case get\n";
}
else
{
$row = $result->fetch(PDO::FETCH_ASSOC);
$id = $row['AUTO_INCREMENT'];
print "id = ".$id."\n";
}
I get this:
id =
So, the query seems to have returned an object, but there is no data in the row for AUTO_INCREMENT?
Is there a better way to do this?
Thanks in advance.
P