php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31848 PHP doesn�t open the database file from SQLite 3.0.8
Submitted: 2005-02-04 18:34 UTC Modified: 2005-02-07 03:33 UTC
From: fernando dot wendt at gmail dot com Assigned:
Status: Not a bug Package: SQLite related
PHP Version: 5.0.3 OS: Windows 2000 Professional
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fernando dot wendt at gmail dot com
New email:
PHP Version: OS:

 

 [2005-02-04 18:34 UTC] fernando dot wendt at gmail dot com
Description:
------------
Hi,

I have downloaded the SQLite 3.0.8 for Windows, and it seems to work fine: via prompt, database created, data inserted, dump done, imports and outputs made.

Then, when trying to make it really works, whith PHP 5.0.3 and Apache 2.0.52, always PHP points an error, that saids "file is not a database or is encrypted".

To make this really hapends, and what motivated me to came here, i get SQLite 2.8.15, created the same database (all right), and with this version PHP works.

The table is very simple: it?s name "tabela", and have two columns "numero" and "nome" (smallint and varchar). Two data inserted: 1-Fernando and 2-Nidiane.

Thats all.

Reproduce code:
---------------
<?php
  $banco = new SQLiteDatabase("exemplo.sqi");
  $res = $banco->unbufferedQuery("Select * from tabela");
  foreach ($res as $row){
	print_r($row);	  
  }
?>

Expected result:
----------------
Array
(
    [0] => 1
    [numero] => 1
    [1] => Fernando
    [nome] => Fernando
)
Array
(
    [0] => 2
    [numero] => 2
    [1] => Nidiane
    [nome] => Nidiane
)

Actual result:
--------------
Warning: SQLiteDatabase::unbufferedQuery() [function.unbufferedQuery.html]: no such table: tabela in C:\Arquivos de programas\Apache Group\Apache2\htdocs\sqlite\exemplo.php on line 3

Warning: Invalid argument supplied for foreach() in C:\Arquivos de programas\Apache Group\Apache2\htdocs\sqlite\exemplo.php on line 4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-05 01:29 UTC] derick@php.net
No bug, PHP uses the SQLite 2.x library which ofcourse can not read SQLite 3 formatted files. (You can have a look at PDO's SQLite3 driver though).
 [2005-02-07 03:33 UTC] fernando dot wendt at gmail dot com
OK, thank you for the information.

I sugest to put it on the docs page, to explain better this version dependece feature about this module.

Best regards,

Fernando Wendt
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 23:03:39 2023 UTC