Home > Archive > PHP DB > October 2005 > Basic SQLite test failing..
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Basic SQLite test failing..
|
|
| Eoin Hennessy 2005-10-30, 7:55 am |
| Hello, I have the following very basic sqlite test harness:
<?php
$dbconn =3D @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 =3D @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.
| |
|
|
Hi,
Errors are more than likely not being produced because of the '@' symbol. Try removing this and see how you go. Also check your code for syntax errors. These will be produced within the errors.
J
---------------------------------------------start of message-------------------------------------------
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 nevercomes
out, i.e. none of the rest of the code is hit. When running viaapache and mod_php, it gets out of 'sqlite_open' with a validconnection but never comes out of the first 'sqlite_query' call.It does this without any errors or warnings. The database file ispr
esent 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.5Any ideas where things are going wrong? Or perhaps tips on improvingdebug output. Any help would be
appreciated,Eoin.
------------------------end of message-------------------
---------------------------------
Do you Yahoo!?
Find a local business fast with Yahoo! Local Search
|
|
|
|
|