Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2008, 09:26 AM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default 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-&gt;_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-&gt;_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-&gt;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-&gt;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..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-29-2008, 01:10 PM
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default

you need to install pdo for sqlite for your php install.

on debian :
apt-get install php5-sqlite
etc/init.d/apache2 restart
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-30-2008, 11:29 AM
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default Enable php_pdo_sqlite.dll

Quote:
Originally Posted by pavithrap View Post
Hi ,
But once I execute the code, I get the following error. The above piece of code I had picked from zend website.
<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

Could anyone please help me with this??? plz..
From your error message I saw you are on Windows.
Locate the used php.ini file and search for Windows extensions.
Make sure you have:

extension=php_pdo.dll
extension=php_pdo_sqlite.dll

(remove the ; before those lines)
/friedhelm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:40 AM.