Re: Basic SQLite test failing..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not terrbily familiar with the SQLite stuff, but a quick look in the docs 
claim a couple things that may help you here:

1) Error messages for sqlite_open are passed by reference. You should use this 
format:
$db = sqlite_open('mysqlitedb', 0666, $sqliteerror) 

And then look at the value of $sqliteerror for clues as to what's going on. 

2) It seems to be oddly classed based, although it's not constructed in the 
docs as a class is, I'm a bit confused on that, but without spending more 
than my 5 minute coffee time on it, I think I'll have to be satisfied with 
that.

I only bring it up as I wonder if the methods don't exist until you 
successfully construct with sqlite_open, therefore your 'undefined function' 
issue. 

-Micah 



On Sunday 30 October 2005 3:03 am, Eoin Hennessy wrote:
> Hello, I have the following very basic sqlite test harness:
>
> <?php
>   $dbconn = @sqlite_open('testdb');
>
>   if ($dbconn) {
>     @sqlite_query($dbconn, "CREATE TABLE test_table (test_id INT);");
>     @sqlite_query($dbconn, "INSERT INTO test_table VALUES (100)");
>
>     $result = @sqlite_query($dbconn, "SELECT test_id FROM test_table");
>     var_dump(@sqlite_fetch_array($result, SQLITE_ASSOC));
>   } else {
>     print "Connection to database failed!\n";
>   }
> ?>
>
> When running via CLI the script goes into 'sqlite_open', but never
> comes out, i.e. none of the rest of the code is hit. When running via
> apache and mod_php, it gets out of 'sqlite_open' with a valid
> connection but never comes out of the first 'sqlite_query' call.
>
> It does this without any errors or warnings. The database file is
> present with correct  permissions. I'm running a standard php install.
>
> I am using:
>   php 4.4.0
>   sqlite 3.2.7
>   sqlite-php 0.0.5
>
> Any ideas where things are going wrong? Or perhaps tips on improving
> debug output. Any help would be appreciated,
>
> Eoin.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux