You are here: Re: SQLite Version 2.1? « PHP Programming Language « IT news, forums, messages
Re: SQLite Version 2.1?

Posted by Andy Hassall on 01/26/07 19:57

On Fri, 26 Jan 2007 01:51:37 -0500, "Jim Carlock" <anonymous@127.0.0.1> wrote:

>"Andy Hassall" <andy@andyh.co.uk> posted...
>: 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_first text, name_last text);";
>$sUserName = "myname";
>$sPW = "My321Goofy123Password";
>$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......utablet|
000003c0 4e 61 6d 65 73 74 4e 61 6d 65 73 02 43 52 45 41 |NamestNames.CREA|
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 :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация