Code to get the next value of autoincrement for a table being used by joomla
$query = "SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '{$databaseName}' AND TABLE_NAME = CONCAT('{$prefix}','stride_data')";
$db->setQuery($query);
$db->query();
$NextId = $db->loadAssocList();
//echo $NextId[0][AUTO_INCREMENT];