Sorry. When I set $db and use $db the message I get is:

Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a 
database in /home/zbfckla/public_html/Ocx.php on line 49
Could not open database



----- Original Message ----- 
From: "P Kishor" <[EMAIL PROTECTED]>
To: "General Discussion of SQLite Database" <[email protected]>
Sent: Sunday, March 09, 2008 5:02 PM
Subject: Re: [sqlite] Beginners bad luck


>I don't know how PHP's db connector works but...
>
> On 3/9/08, Aharon (Rony) Shapira <[EMAIL PROTECTED]> wrote:
>>
>>  I created a simple table named "books" in "library.db".
>>  After entering "select * from books" I saw the data that I put into it.
>>
>>  When trying to access it through php:
>>  $file = "library.db";
>>  // open database file
>>
>>  $handle = sqlite_open($db) or die("Could not open database");
>
> Is that a typo? You are setting $file, but trying to open $db.
>
>
>>
>>  I got the following:
>>
>>  "Could not open database"
>>
>>
>>
>>  When I tried the following:
>>
>>  $file = "library.db";
>>
>>  // create database object
>>
>>  $db = new SQLiteDatabase($file) or die("Could not open database");
>>
>>  I got the following:
>>
>>  Fatal error: Uncaught exception 'SQLiteException' with message 
>> 'SQLiteDatabase::__construct() [<a 
>> href='function.SQLiteDatabase---construct'>function.SQLiteDatabase---construct</a>]:
>>  
>> file is encrypted or is not a database' in 
>> /home/zbfckla/public_html/Ocx.php:17 Stack trace: #0 
>> /home/zbfckla/public_html/Ocx.php(17): 
>> SQLiteDatabase->__construct('library.db') #1 {main} thrown in 
>> /home/zbfckla/public_html/Ocx.php on line 17
>>
>>
>>
>>  Once again I apologies for these silly questions.
>>
>>  Aharon
>>  _______________________________________________
>>  sqlite-users mailing list
>>  [email protected]
>>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
> -- 
> Puneet Kishor http://punkish.eidesis.org/
> Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
> Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to