如何检查哪个版本的SQLite PDO使用?

时间:2015-12-23 17:04:17

标签: php sqlite pdo

我在迁移到PDO之前使用了这段代码:

    if (class_exists('SQLiteDatabase')) {
        return 'jargon.db';
    } else if (class_exists('SQLite3')) {
        return 'jargon3.db';
    } else {
        throw new Exception('SQLite not installed');
    }

如何使用PDO

进行相同的操作

1 个答案:

答案 0 :(得分:3)

要检查SQLite版本,您可以使用以下代码:

 $scope.amount = function(newValue) {
  return arguments.length ? ($scope._amount = newValue) : $scope._amount;
};