Database Table Authentication
Hi ,
For Database Table Authentication using Zend, I had written the following code.
<?php
require_once 'Zend/Db/Adapter/Pdo/Sqlite.php';
$dbAdapter = new Zend_Db_Adapter_Pdo_Sqlite(array('dbname' => 'test'));
$sqlCreate = 'Create Table [users] ('
.'[id] INTEGER NOT NULL PRIMARY KEY'
.'[username] varchar(45) UNIQUE NOT NULL'
.'[password] varchar(32) NULL'
.'[real_name] varchar(150) NULL)';
$dbAdapter->query($sqlCreate);
$sqlInsert = 'INSERT INTO users (username, password, real_name)
VALUES ("pavithrap", "pavi", "Pavithra Paulraj")';
$dbAdapter->query($sqlInsert);
?>
But once I execute the code, I get the following error. The above piece of code I had picked from zend website.
<br />
<b>Fatal error</b>: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The sqlite driver is not currently installed' in C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendFramework\library\Zend\Db\Adapter\Pd o\Abstract.php:104
Stack trace:
#0 C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendFramework\library\Zend\Db\Adapter\Pd o\Sqlite.php(138): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendFramework\library\Zend\Db\Adapter\Ab stract.php(380): Zend_Db_Adapter_Pdo_Sqlite->_connect()
#2 C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendFramework\library\Zend\Db\Adapter\Pd o\Abstract.php(206): Zend_Db_Adapter_Abstract->query('Create Table [u...', Array)
#3 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Zend\Authentication\si mpleAuth.php(9): Zend_Db_Adapter_Pdo_Abstract->query('Create Table [u...')
#4 C:\Program Files\Zend\ZendStudio-5.5.1\bin\php5\dummy.php(1): include('C:\Program File...')
#5 {main}
thrown in <b>C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendFramework\library\Zend\Db\Adapter\Pd o\Abstract.php</b> on line <b>104</b><br />
Could anyone please help me with this??? plz..
|