Basic SQLite test failing..
Basic SQLite test failing..
am 30.10.2005 12:03:10 von Eoin Hennessy
Hello, I have the following very basic sqlite test harness:
$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.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Basic SQLite test failing..
am 30.10.2005 18:18:47 von Micah Stevens
Take out the @ symbols so you can get some errors?
On Sunday 30 October 2005 3:03 am, Eoin Hennessy wrote:
> Hello, I have the following very basic sqlite test harness:
>
>
> $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
RE: Basic SQLite test failing..
am 30.10.2005 18:36:13 von jusa_98
--0-2129802175-1130693773=:61072
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
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: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 ispresent 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 whe
re 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
--0-2129802175-1130693773=:61072--
Re: RE: Basic SQLite test failing..
am 31.10.2005 06:44:56 von Eoin Hennessy
Ahh, I'm not very familiar with php, should have looked into the
effects of the '@' symbol. Once removing the symbols, running via CLI,
it fails with;
'Call to undefined function: sqlite_open()'
whereas, running via apache, it fails with;
'Call to undefined function: sqlite_query()'
I have sqlite and sqlite_php installed and enabled in php.ini (there's
an entry under phpinfo()).
Any ideas why it may be failing? Thanks again.
On 10/30/05, JeRRy wrote:
>
> 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 er=
rors. These will be produced within the errors.
>
>
>
> J
>
>
>
> ---------------------------------------------start of message------------=
-------------------------------
>
>
> Hello, I have the following very basic sqlite test harness:
=3D @sqlite_open('testdb'); if ($dbconn) { @sqlite_query($dbconn, "CRE=
ATE TABLE test_table (test_id INT);"); @sqlite_query($dbconn, "INSERT IN=
TO 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 r=
unning 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, i=
t gets out of 'sqlite_open' with a validconnection but never comes out of t=
he first 'sqlite_query' call.It does this without any errors or warnings. T=
he database file ispresent with correct permissions. I'm running a standar=
d php install.I am using: php 4.4.0 sqlite 3.2.7 sqlite-php 0.0.5Any ide=
as 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
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: RE: Basic SQLite test failing..
am 31.10.2005 10:39:17 von Eoin Hennessy
According to the manual the second and third parameters of sqlite_open
are optional and apparantly the mode value is ignored. Out of
interest, I tried them anyway and; running via CLI fails again with;
''Call to undefined function: sqlite_open()'
But running via apache this time fails with;
'Wrong parameter count for sqlite_open()'
I did a syntax check (lint) and all is ok. I'm running on an ext3
partition with php version 4.4.0.
Thanks,
Eoin.
On 10/31/05, Jackson wrote:
> Also, I just took a closer look at your syntax. I'm not familiar with sql=
ite
> query syntax, but I think you may have some syntax errors. -Jackson
>
>
>
> On 10/31/05, Jackson wrote:
> >
> > Eoin, I'm wondering if the problem isn't in your sqlite_open function. =
If
> I recall rightly, it can take more parameters, specifically, a mode
> parameter in octal. Zend.com manual on sqlite functions recommends a mode
> value of 0666. Also on the Zend site is a tip about running SQLite databa=
ses
> on NFS paritions. I don't know what sort of server configuration you've g=
ot,
> but apparently NFS causes locking problems that can prevent you from even
> opening the database. That you're getting errors about calls to unknown
> functions is concerning, but I don't have a good offering about it, just
> seems like PHP is not supporting your sqlite functions. Are you running P=
HP
> 4 or 5? If I recall, SQLite functions are not part of PHP 4. Maybe that's
> the problem? I really don't know.
> >
> > Good luck!
> > Jackson
> >
> >
> >
> >
> > On 10/30/05, Eoin Hennessy wrote:
> > > Ahh, I'm not very familiar with php, should have looked into the
> > > effects of the '@' symbol. Once removing the symbols, running via CLI=
,
> > > it fails with;
> > >
> > > 'Call to undefined function: sqlite_open()'
> > >
> > > whereas, running via apache, it fails with;
> > >
> > > 'Call to undefined function: sqlite_query()'
> > >
> > > I have sqlite and sqlite_php installed and enabled in php.ini (there'=
s
> > > an entry under phpinfo()).
> > >
> > > Any ideas why it may be failing? Thanks again.
> > >
> > > On 10/30/05, JeRRy < jusa_98@yahoo.com> wrote:
> > > >
> > > > 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:
> $dbconn =3D @sqlite_open('testdb'); if ($dbconn) { @sqlite_query($dbc=
onn,
> "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 nevercome=
s
> 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 co=
mes
> out of the first 'sqlite_query' call.It does this without any errors or
> warnings. The database file ispresent with correct permissions. I'm runn=
ing
> 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
> > > >
> > >
> > > --
> > > PHP Database Mailing List ( http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Basic SQLite test failing..
am 31.10.2005 17:58:25 von Micah Stevens
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:
>
>
> $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
Re: RE: Basic SQLite test failing..
am 01.11.2005 01:06:28 von jusa_98
--0-1859310879-1130803588=:63301
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
It's not aware of function sqlite_query() So you need to define what it is. There is alot of docs for fixes/workarounds for this online in sqlite docs.
Eoin Hennessy wrote:Ahh, I'm not very familiar with php, should have looked into the
effects of the '@' symbol. Once removing the symbols, running via CLI,
it fails with;
'Call to undefined function: sqlite_open()'
whereas, running via apache, it fails with;
'Call to undefined function: sqlite_query()'
I have sqlite and sqlite_php installed and enabled in php.ini (there's
an entry under phpinfo()).
Any ideas why it may be failing? Thanks again.
On 10/30/05, JeRRy wrote:
>
> 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: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 ispresent 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
>
---------------------------------
Do you Yahoo!?
Find a local business fast with Yahoo! Local Search
--0-1859310879-1130803588=:63301--