Hi,
I'm currently trying to learn how to use php gtk2 to work with sqlite in stand alone application.
If i try to open it in browser all working.
But, its not working when i try to use php gtk and open it in stand alone application.
i've already enabled the php_sqlite.dll extensions in the php-cli.ini
Here is my code.
<?php
try
{
//create or open the database
//$database = new SQLiteDatabase('myDatabase.sqlite', 0666, $error);
$database = new SQLiteDatabase('C:\php-gtk\demos\test.sqlite', 0666, $error);// it doesnt need any particular extension. can be .doc, .sqlite etc
if ($database)
{
echo "connected";
} else {
die($error);
}
}
catch(Exception $e)
{
die($error);
}
//add User table to database
$query = 'CREATE TABLE t_users ' .
'(Id Int, Name varchar(100))';
if(!$database->queryExec($query, $error))
{
die($error);
}
//insert data into database
$query =
'INSERT INTO t_users (Id, Name) ' .
'VALUES (1, "John"); ' .
'INSERT INTO t_users (Id, Name) ' .
'VALUES (2, "Janice"); ' .
'INSERT INTO t_users (Id, Name) ' .
'VALUES (3, "Raja")';
if(!$database->queryExec($query, $error))
{
die($error);
}
//read data from database
$query = "SELECT * FROM t_users";
if($result = $database->query($query, SQLITE_BOTH, $error))
{
while($row = $result->fetch())
{
print("ID: {$row['Id']} <br />" .
"Name: {$row['Name']} <br /><br />");
}
}
else
{
die($error);
}
?>
When i try to run the file, its give me
Fatal Error: Class 'SQLiteDatabase' not found in c:\\
Well I don't have any Ideas.
I took the php_sqlite.dll from my installation of php.
If anyone has any Ideas please help.
Thank you.