php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26389 Use an sqlite db...
Submitted: 2003-11-24 16:46 UTC Modified: 2003-12-01 03:13 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: php at plouk dot net Assigned:
Status: No Feedback Package: SQLite related
PHP Version: 5.0.0b2 (beta2) OS: Linux debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-11-24 16:46 UTC] php at plouk dot net
Description:
------------
This script isn't able to create a table in an existing database. Why? (No error are detected and permissions on the database file seem all right)


#ls -l

-rw-rw-r--    1 nobody   nogroup       263 Nov 24 23:42 sqlite.php
-rw-rw-rw-    1 nobody   nogroup         0 Nov 24 22:45 test.db

Reproduce code:
---------------
<?php
//sqlite.php
$db=sqlite_open('test.db', 0666, $sqlite_err);

echo var_dump($db).'<BR />';
echo var_dump($sqlite_err).'<BR />';

$req="CREATE TABLE my_table (value INTEGER PRIMARY KEY)";

$res=sqlite_query($db,$req);

echo var_dump($res).'<BR />';

sqlite_close($db);
?>


Expected result:
----------------
A table

Actual result:
--------------
Nothing, the db file is always a 0 byte's file...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-24 16:48 UTC] php at plouk dot net
The script result :
------------------
resource(2) of type (sqlite database)
NULL
bool(false)
 [2003-11-24 20:03 UTC] iliaa@php.net
If you are running it not via a webserver (user != nobody) chmod the file 666. Otherwise re-open the bug.
 [2003-11-25 12:44 UTC] php at plouk dot net
The script run via a webserver...
 [2003-11-25 15:50 UTC] iliaa@php.net
Works just fine, try changing your query line to:
$res = sqlite_query($db,$req) or die(sqlite_error_string(sqlite_last_error($db)));

and see what error (if any) do you get.
 [2003-12-01 03:13 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 20 03:03:36 2021 UTC