473,549 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLite Version 2.1?

I added the following lines to PHP.INI.

extension=php_p do.dll
extension=php_p do_sqlite.dll
extension=php_s qlite.dll

specifically in that order. I noticed the extensions getting loaded
are alphabetally listed, so I'm thinking that the order of the load
doesn't matter.

Is that true?

And when I use the following statements to create a test.db file...
It creates a file with the following text as the first 48 characters
in the file...

** This file contains an SQLite 2.1 database **

Searching php.net for that string turned up the following link:

http://gcov.php.net/PHP_5_2/lcov_htm...ree.c.gcov.php

It appears that PHP 5.2 mis-identifies the file. I took a look at
some other software found at SourceForge advertised as a
visual front end to access and create SQLite databases. However,
the SQLite Browser identifies the SQLite data file as NOT a 3.1
version (perhaps due to PHP's mis-tagging (?)).

http://sqlitebrowser.sourceforge.net
http://sourceforge.net/projects/sqlitebrowser

Can anyone else confirm this?

Thanks.

--
Jim Carlock
Post replies to the group.
http://www.microcosmotalk.com/tech/windows/php/sqlite
Jan 23 '07 #1
4 8016
"Jim Carlock" wrote:
: I added the following lines to PHP.INI.
:
: extension=php_p do.dll
: extension=php_p do_sqlite.dll
: extension=php_s qlite.dll
:
: specifically in that order. I noticed the extensions getting loaded
: are alphabetally listed, so I'm thinking that the order of the load
: doesn't matter.
:
: Is that true?

I don't have an answer to that question.

: And when I use the following statements to create a test.db file...

I forgot to type in the statements. The [extension=php_s qlite.dll]
line above provides the mechanisms...

sqlite_array_qu ery()
sqlite_busy_tim eout()
sqlite_changes( )
sqlite_close()
sqlite_column()
sqlite_create_a ggregate()
sqlite_create_f unction()
sqlite_current( )
sqlite_error_st ring()
sqlite_escape_s tring()
sqlite_exec()
sqlite_factory( )
sqlite_fetch_al l()
sqlite_fetch_ar ray()
sqlite_fetch_co lumn_types()
sqlite_fetch_ob ject()
sqlite_fetch_si ngle()
sqlite_fetch_st ring()
sqlite_has_more ()
sqlite_has_prev ()
sqlite_key()
sqlite_last_err or()
sqlite_next()
sqlite_prev()
sqlite_rewind()
sqlite_seek ()
sqlite_query()
sqlite_query()
sqlite_open()
sqlite_popen()

There's a sqlite.api file available at with provides the parameter lists
for SciTE at the following link...

http://www.microcosmotalk.com/tech/windows/php/sqlite

// The following makes the data file, and creates a table in it...
// The file created though, contains the following string identifying
// it as:
// ** This file contains an SQLite 2.1 database **

var $hDb;
var $sSQL_MT;
var $sErrMsg;

$hDb = sqlite_open("pa th_to_folder/names.db", 0666, $sErrMsg);
$sSQL_MT = "CREATE TABLE (first_name text, last_name text);";
sqlite_exec($hD b, $sSQL_MT, $sErrMsg);
sqlite_close($h Db);

My aplogies about leaving that out in the last post.

: Searching php.net for that string turned up the following link:
:
: http://gcov.php.net/PHP_5_2/lcov_htm...ree.c.gcov.php
:

I believe I've identified a way to create SQLite version 3 files.
It involves commenting the following line out of the PHP.INI.

; extension=php_s qlite.dll

I'll update this thread once I get a query together to test out
creating a PDO object to create the file, unless someone else
has already run through this and beats me to it.

: It appears that PHP 5.2 mis-identifies the file. I took a look
: at some other software found at SourceForge advertised as
: a visual front end to access and create SQLite databases.
: However, the SQLite Browser identifies the SQLite data file
: as NOT a 3.1 version (perhaps due to PHP's mis-tagging (?)).
:
: http://sqlitebrowser.sourceforge.net
: http://sourceforge.net/projects/sqlitebrowser
:
: Can anyone else confirm this?

I answered that question in the above comments.

There's two SciTE .api files at the following link with instructions
on how to get the SQLite API drop-downs/parameters activated
in SciTE at the following link (sqlite.api and pdo.api).
http://www.microcosmotalk.com/tech/windows/php/sqlite

--
Jim Carlock
Post replies to the group.
http://www.microcosmotalk.com/tech/windows/php/sqlite
Jan 23 '07 #2
On Tue, 23 Jan 2007 18:29:59 -0500, "Jim Carlock" <an*******@127. 0.0.1wrote:
>"Jim Carlock" wrote:
: I added the following lines to PHP.INI.
:
: extension=php_p do.dll
: extension=php_p do_sqlite.dll
: extension=php_s qlite.dll
:
: specifically in that order. I noticed the extensions getting loaded
: are alphabetally listed, so I'm thinking that the order of the load
: doesn't matter.
:
: Is that true?

I don't have an answer to that question.
It doesn't appear to matter what order they're listed.
>: And when I use the following statements to create a test.db file...

I forgot to type in the statements. The [extension=php_s qlite.dll]
line above provides the mechanisms...
[snip]

Possibly just to add to the confusion, it appears that php_pdo_sqlite. dll is
linked against SQLite 3.x, but php_sqlite.dll is linked against 2.x:

$ strings php_sqlite.dll | grep -i sqlite[23]
sqlite2
sqlite2_create_ function
ext\sqlite\pdo_ sqlite2.c

$ strings php_pdo_sqlite. dll | grep -i sqlite[23]
sqlite3_extensi on_init
sqlite3_get_tab le() called with two or more incompatible queries

See also:
http://bugs.php.net/bug.php?id=34010
http://bugs.php.net/bug.php?id=31848

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 24 '07 #3
"Andy Hassall" <an**@andyh.co. ukposted...
: Possibly just to add to the confusion, it appears that php_pdo_sqlite. dll
: is linked against SQLite 3.x, but php_sqlite.dll is linked against 2.x:

Yes, that's exactly what I see. The first characters of the data files, when
viewed with a hex viewer identify the versions. Specifically, here's what
I see...

"** This file contains an SQLite 2.1 database **"
"SQLite format 3"

The syntax to create the version 3 file...

$sDSN = "sqlite:./test/test.db";
$sSQL = "CREATE TABLE tNames(name_fir st text, name_last text);";
$sUserName = "myname";
$sPW = "My321Goofy123P assword";
$hPDO = new PDO($sDSN, $sUserName, $sPW);
$hPDO->exec($sSQL);
$hPDO = null;

The above created the table in the appropriate folder with two fields,
as expected.

I got into the data file using the SQLite Database Browser, from here,
http://sqlitebrowser.sourceforge.net/, and view the internals of the file
created by the above statements. However, I noticed it didn't require
a username nor password to get into the file and add new data to the
file. I'm missing out on something as far getting a userid and password to
work for the file.

Thanks for your comments, Andy.

--
Jim Carlock
Post replies to the group.
http://www.microcosmotalk.com/tech/windows/php/sqlite
Jan 26 '07 #4
On Fri, 26 Jan 2007 01:51:37 -0500, "Jim Carlock" <an*******@127. 0.0.1wrote:
>"Andy Hassall" <an**@andyh.co. ukposted...
: Possibly just to add to the confusion, it appears that php_pdo_sqlite. dll
: is linked against SQLite 3.x, but php_sqlite.dll is linked against 2.x:

Yes, that's exactly what I see. The first characters of the data files, when
viewed with a hex viewer identify the versions. Specifically, here's what
I see...

"** This file contains an SQLite 2.1 database **"
"SQLite format 3"

The syntax to create the version 3 file...

$sDSN = "sqlite:./test/test.db";
$sSQL = "CREATE TABLE tNames(name_fir st text, name_last text);";
$sUserName = "myname";
$sPW = "My321Goofy123P assword";
$hPDO = new PDO($sDSN, $sUserName, $sPW);
$hPDO->exec($sSQL);
$hPDO = null;
OK, I get a different result. I get just the format 3 label in the datafile.
This is on Windows XP:

$ php -v
PHP 5.2.0 (cli) (built: Nov 2 2006 11:57:36)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

This is from the standard Windows binary distribution from php.net.

The file it produces is below:

$ hexdump -C test.db
00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.|
00000010 04 00 01 01 00 40 20 20 00 00 00 01 00 00 00 00 |.....@ ........|
00000020 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 |.............. ..|
00000030 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 |.............. ..|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.............. ..|
*
00000060 00 00 00 00 0d 00 00 00 01 03 b2 00 03 b2 00 00 |.............. ..|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.............. ..|
*
000003b0 00 00 4c 01 06 17 19 19 01 75 74 61 62 6c 65 74 |..L......utabl et|
000003c0 4e 61 6d 65 73 74 4e 61 6d 65 73 02 43 52 45 41 |NamestNames.CR EA|
000003d0 54 45 20 54 41 42 4c 45 20 74 4e 61 6d 65 73 28 |TE TABLE tNames(|
000003e0 6e 61 6d 65 5f 66 69 72 73 74 20 74 65 78 74 2c |name_first text,|
000003f0 20 6e 61 6d 65 5f 6c 61 73 74 20 74 65 78 74 29 | name_last text)|
00000400 0d 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 |.............. ..|
00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.............. ..|
*
00000800
>I got into the data file using the SQLite Database Browser, from here,
http://sqlitebrowser.sourceforge.net/, and view the internals of the file
created by the above statements. However, I noticed it didn't require
a username nor password to get into the file and add new data to the
file. I'm missing out on something as far getting a userid and password to
work for the file.
I didn't think SQLite supported username or passwords.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 26 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1884
by: bartolomesintes | last post by:
Hi, I have installed PHPHome 2.3.4 in Windows XP. This WAMP package installs Apache 2.0.50 , PHP 5.0.0 and it works fine. The SQLite installed version is 2.8.14 and I would like to upgrade to a later version. Is it possible? Is the upgrading process explained somewhere? Thanking you in advance, Barto
3
4191
by: Cafer ÅžimÅŸek | last post by:
Hi all, I want to use SQLite databases to my site. But the hosting company's server does not support SQLite extension. Is there any way to use SQLite DB's to my site? PS: safe mode is off, php version is 4.3.4 Thanks
1
2568
by: David Fowler | last post by:
I'm new to getting in touch with other PHP users/PHP team, so please excuse me if this post is at all inappropriate or in the wrong place. In the current release of PHP (5.1.4) and in the CVS for PHP5.1.* and 5.2.* the SQLite source version only stands at 3.2.8, while the actual realease is now at 3.3.6. What I was wondering is whether or not...
12
2464
by: John Salerno | last post by:
I've been looking around and reading, and I have a few more questions about SQLite in particular, as it relates to Python. 1. What is the current module to use for sqlite? sqlite3? or is that not out until Python 2.5? 2. What's the difference between sqlite and pysqlite? Do you need both, just one, or is one an older version of the same...
14
2957
by: 7stud | last post by:
Does sqlite come in a mac version? Thanks.
9
7083
by: Gilles Ganault | last post by:
Hello I was looking for a lighter web server than Apache, and installed Lighttpd on CentOS through yum. It works fine, but I now need to use SQLite from a PHP script. I seem to understand that it can either be access directly, or through the PDO interface. Can you confirm that the RPM that I used will only allow me to work through PDO,...
8
3403
by: Gilles Ganault | last post by:
Hello I need to compile PHP5 with SQLite statically and without PDO. I don't need DB-independence, so it's fine using sqlite_*() functions instead of PDO. 1. I've downloaded, compiled, and installed sqlite.org/sqlite-3.5.4.tar.gz, and... 2. used "--with-sqlite --disable-pdo", but it fails.
9
2585
by: Ed Leafe | last post by:
On Apr 21, 2008, at 1:05 PM, Daniel Fetchinson wrote: Don't most binary distributions include SQLite itself? I installed 2.5.2 on a new WinXP VM, and SQLite is working fine. -- Ed Leafe
0
2564
by: Joe Goldthwaite | last post by:
Thanks Guilherme. That helped. I guess I was thinking that pysqlite would automatically come with some version of sqlite. The fact that it doesn't is what was causing me to get the strange results. I downloaded the Windows version of the SQLite3.dll. I didn't know where to put it so I first put it in its own directory and tried to...
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7726
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7485
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.