Error 1: 1 Uncaughtexception & amp; #39; PDOException & amp; #39; withmessage & amp; #39; couldnotfinddriver1. open the php. ini file 1extensionphp_pdo.dll and remove 1extensionphp_pdo_sqlite
Error 1:
1 Uncaught exception 'pdoexception' with message' could not find driver
1. open the php. ini file.
1 extension = php_pdo.dll
Remove
1 extension = php_pdo_sqlite.dll
2. restart the apache service.
3. write test code
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. successful!
Author: jeffsui