Topic: Sqlite 3 / PHP PDO support

This feature request would give the option to use the PDO extensions in php and also allow usage of sqlite v3.

Re: Sqlite 3 / PHP PDO support

Here is the list of databases that would possibly be useable with this.
18      PDO_DBLIB      FreeTDS/Sybase/MSSQL driver for PDO     
19     PDO_FIREBIRD     Firebird/InterBase 6 driver for PDO    
20     PDO_IDS     PDO driver for IBM Informix IDS databases    
21     PDO_MYSQL     Mysql 3.x/4.0 driver for PDO    
22     PDO_OCI     Oracle Call Interface driver for PDO    
23     PDO_ODBC     ODBC v3 Interface driver for PDO    
24     PDO_PGSQL     PostgreSQL driver for PDO    
25     PDO_SQLITE     SQLite v3 Interface driver for PDO

Re: Sqlite 3 / PHP PDO support

PDO is only in php 5.1 isn't it ? tongue

4 (edited by Tenkawa 2005-10-20 18:00)

Re: Sqlite 3 / PHP PDO support

No. It is "integrated" with 5.1, with 5.0 it is a module from http://pecl.php.net
Direct link is : http://pecl.php.net/package-search.php? … mit=Search

Re: Sqlite 3 / PHP PDO support

PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database  abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility.

PDO wouldn't add a lot to PunBB since PunBB already has an abstraction layer. The only advantage, except current support for sqlite3, would be that the functions used in the abstraction layer would be the same, but that doesn't help at all. The only potential use for PDO in PunBB would be prepared statements/parameters, but that's not something you do in an afternoon. To top things off, the support for PDO among hosting companies is minimal at best. We can expect that to be true for some time.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Sqlite 3 / PHP PDO support

download php_sqlite3 and test please

Re: Sqlite 3 / PHP PDO support

Rickard wrote:

PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database  abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility.

PDO wouldn't add a lot to PunBB since PunBB already has an abstraction layer. The only advantage, except current support for sqlite3, would be that the functions used in the abstraction layer would be the same, but that doesn't help at all. The only potential use for PDO in PunBB would be prepared statements/parameters, but that's not something you do in an afternoon. To top things off, the support for PDO among hosting companies is minimal at best. We can expect that to be true for some time.

Unfortunately I have to agree on hosting support for PDO. It has been very minimal that I've seen out there at best.
Tenkawa

Re: Sqlite 3 / PHP PDO support

Rickard wrote:

PDO wouldn't add a lot to PunBB since PunBB already has an abstraction layer.

I'm not sure about this, but doesn't PDO actively convert queries from one SQL language to another  e.g. you can use it to run mysql queries on firebird?

Re: Sqlite 3 / PHP PDO support

ConnorHd: Read the quote i posted earlier smile

PDO adds a unified function naming scheme and in some cases, allows for the use of prepared statements and SQL parameters. That's it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Sqlite 3 / PHP PDO support

well i didn't understand what any of that meant tongue

Re: Sqlite 3 / PHP PDO support

SQLite 3.2.0+ support "ALTER TABLE",
and lots of Mod. can't install in current SQLite 2.x,
it will be nice if next version to support SQLite 3.2.0+ smile

12

Re: Sqlite 3 / PHP PDO support

yeah.. I really need SQLite 3 support..

Re: Sqlite 3 / PHP PDO support

In Fact, I had a testing forum which used SQLite3 DB that convert from SQLite2.
I just know a little php, so wrote an example php to test SQLite3 DB:

<?
$db = sqlite3_open("punbb.db3");
$query = sqlite3_query($db, "SELECT poster,message FROM posts");
if (!$query) die (sqlite3_error($db));
while ( ($row = sqlite3_fetch_array($query)) )
{
    echo $row['poster'], $row['message'];
    echo "\n";
}
sqlite3_query_close($query);
sqlite3_close ($db); 
?>

and it just work fine.

But PunBB just show a empty page when i try to change some code in include\dblayer\sqlite.php like this:
from
sqlite_xxx()
to
sqlite3_xxx()

I thought it should be easy for people that familiar with php convert to SQLite3. smile

Re: Sqlite 3 / PHP PDO support

jimchen wrote:

In Fact, I had a testing forum which used SQLite3 DB that convert from SQLite2.
I just know a little php, so wrote an example php to test SQLite3 DB:

<?
$db = sqlite3_open("punbb.db3");
$query = sqlite3_query($db, "SELECT poster,message FROM posts");
if (!$query) die (sqlite3_error($db));
while ( ($row = sqlite3_fetch_array($query)) )
{
    echo $row['poster'], $row['message'];
    echo "\n";
}
sqlite3_query_close($query);
sqlite3_close ($db); 
?>

and it just work fine.

But PunBB just show a empty page when i try to change some code in include\dblayer\sqlite.php like this:
from
sqlite_xxx()
to
sqlite3_xxx()

I thought it should be easy for people that familiar with php convert to SQLite3. smile

the only way to acces sqlite3 is through PDO.