FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » sqlite and php
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: sqlite and php [message #175885 is a reply to message #175880] Thu, 03 November 2011 22:57 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 11/3/2011 4:30 PM, Anne Achey wrote:
> Hi,
>
> Anyone know how to create a sqlite database from PHP code? I am trying
> the code below:
>
> try
> {
> //create or open the database
> $database = new SQLiteDatabase('myDatabase.db', 0666, $error);
> }
> catch(Exception $e)
> {
> die($error);
> }
>
> But when I try to access this database with the sqlite browser, it
> tthrows an error saying the "file is not a SQL3 Database"
>
> Error at the following link
> http://imageshack.us/photo/my-images/259/errortz.png/
>
> I then created the database manually from the sqlite command line and
> tried to access it with PDO in PHP. I was able to do this, but again I
> also want to be able to CREATE A DATABASE be it with PDO or
> SQLiteDatabase.
> Any help will be appreciated!
>
> AA

It should work. What version of PHP are you using, and what version of
the sqlite browser are you using?

Your problem could easily be something as simple as a back level browser
not compatible with a newer version of SQLite (or a lot of other things).

Additionally, depending on the OS you're using, does the Sqlite browser
have permission to access the file created by PHP? Often times,
especially in Linux/Unix, the browser has different privileges than the
CLI user.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: email sent from webpage is classed as junk
Next Topic: session cookie: client side
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 07:04:00 GMT 2024

Total time taken to generate the page: 0.03992 seconds