错误1:
Uncaught exception 'PDOException' with message 'could not find driver
1.打开php.ini文件
extension=php_pdo.dll
同时去掉
extension=php_pdo_sqlite.dll
2.重启apache服务
3.编写测试代码
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->exec(' CREATE TABLE tally( QID varchar(32) NOT NULL, AID integer NOT NULL, votes integer NOT NULL, PRIMARY KEY(QID,AID) )'); } catch (Exception $e) { echo "error!!:$e"; exit; }echo "db created successfully!";?>
4.成功!