欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php涓嬩娇鐢≒DO鍒涘缓sqlite3鏁版嵁搴揰PHP鏁欑▼ | 甯涔嬪

程序员文章站 2022-05-30 20:20:23
...
閿欒1锛?br /> 1 Uncaught exception 'PDOException' with message 'could not find driver
1.鎵撳紑php.ini鏂囦欢
1 extension=php_pdo.dll
鍚屾椂鍘绘帀
1 extension=php_pdo_sqlite.dll
2.閲嶅惎apache鏈嶅姟
3.缂栧啓娴嬭瘯浠g爜

01 02 echo "creating a databse \n";
03 try {
04 $dbh=new PDO('sqlite:voting.db');
05 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
06 $dbh->exec('
07 CREATE TABLE tally(
08 QID varchar(32) NOT NULL,
09 AID integer NOT NULL,
10 votes integer NOT NULL,
11 PRIMARY KEY(QID,AID)
12 )');
13 www.2cto.com
14
15 } catch (Exception $e) {
16 echo "error!!:$e";
17 exit;
18
19 }
20 echo "db created successfully!";
21 ?>
4.鎴愬姛锛?/p>
浣滆€咃細jeffsui

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478159.htmlTechArticle閿欒1锛?1Uncaught exception PDOException with message could not find driver 1.鎵撳紑php.ini鏂囦欢 1extension=php_pdo.dll 鍚屾椂鍘绘帀 1extension=php_pdo_sqlite.dll 2.閲嶅惎apach...