introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.

Go to Topic: PreviousNext
Go to: Message ListNew TopicSearchLog InPrint View

SQLite problem



Posted by: pja
November 07, 2009 07:43AM
Hi!

I am new to this forum and have just started using EasyPHP instead of XAMP (which is a bit bloated compared with EasyPHP). I am also in the process of trying to learn PHP using a Zend online course. The following code scrap is from my other PC running XAMP (where it works fine).

I am getting the following error message:

Fatal error: Call to undefined function sqlite_open() in C:\Program Files\EasyPHP5.3.0\www\dev\109-05.php on line 37

Line 37 is the "// open database file"

I have tried to place the SQLite database in a number of different locations (changing the path setting as appropriate):

C:\Program Files\EasyPHP5.3.0\www\dev\library.db (which is the same directory as the PHP script

C:\Program Files\EasyPHP5.3.0\www\data\library.db

C:\Program Files\EasyPHP5.3.0\data\library.db

None seem to make any difference, I still get the same error message.

Can anyone please advise me:

1. Does SQLite run with EasyPHP (it looks like it is installed); and

2. what the correct file path for a SQLite database file out to be.

Regards,
Peter

----- CODE SNIPPET -----

// set path of database file
$db = $_SERVER['DOCUMENT_ROOT']."/../data/library.db";

// open database file
$handle = sqlite_open($db) or die("Could not open database");

// generate query string
$query = "SELECT DISTINCT author FROM books";

// execute query
$result = sqlite_query($handle, $query) or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle)));

// if rows exist
if (sqlite_num_rows($result) > 0) {
...
Options: ReplyQuote
Posted by: Amour
November 08, 2009 12:02AM
Maybe you can uncomment that line into php.ini (conf_files) :
;extension=php_sqlite.dll (remove ;)
That's work ?
Options: ReplyQuote


Go to: Message ListSearchLog In
Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.