On Wed, 25 Sep 2013 20:58:05 -0400, Aryc <alagnaryt...@gmail.com> wrote:

>first - thanks for all the insights.
>the versions are different (Ugh) but that raises a new question "how do i 
>correct that?"
>these versions were defined by the download of PHP and Python (IE i didn't get 
> the choice)
>below is the PHP code and Python code i used, followed by a hex dump of the 
>beginning of the database file
>========================
>php code=================
><?php
>$yourfile = 'DTrial.sqlite';
>$database = new SQLiteDatabase($yourfile, 0666, $error);
>if (!$database) {
>    $error = (file_exists($yourfile)) ? "Impossible to open, check 
> permissions" : "Impossible to create, check permissions";
>    die($error);
>}

[code snipped]

PHP has both sqlite2 (named sqlite) and sqlite3.
http://www.php.net/manual/en/refs.database.vendors.php

The PHP sqlite3 API has changed over the years, you may have to rewrite
your code. 

If you have valuable data in the database, you can convert it by one of
several methods:

* use the PHP sqlite2 API to read the v2 database contents
  and the PHP sqlite3 API to write it into a new v3 db

* writing the contents to a text file with v2 code
  and importing that with v3 code

* or (easiest) by using the sqlite command line tools:
  sqlite old-sqlite2db .dump | sqlite3 new-sqlite3db

The latter method will not result in an optimal schema, you'd better
refactor that.

The sqlite v2 command line tool may be buried somewhere deep in your PHP
installation. If you can't find it anywhere, contact me off list so I
can send you a download link (.zip file with MS Windows .exe and .dll,
v2.8.17). It used to be still available from sqlite.org, but I don't
know the hidden URL. You can build it yourself by checking out the
correct version of the fossil repositories (links at the bottom of the
http://sqlite.org/download.html page).

Hope this helps.

-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to