You are here: Re: Connecting to SQLite3 database from PHP 5.25 « PHP Programming Language « IT news, forums, messages
Re: Connecting to SQLite3 database from PHP 5.25

Posted by Kim on 12/07/07 10:25

On Dec 4, 11:40 am, "John" <jo...@faramir.nl> wrote:
> Hi,
>
> I'm trying to connect to a SQLite3 database for days now but I'm stuck. PHP
> returns an error that I made a "call to undefined function sqlite_open(). In
> the php.ini the extension=php_pdo.dll and extension=php_sqlite.dll are set.
> What am I doing wrong???
>
> Thank you in advance,
> John

SQLite3 is only supported with PDO in PHP 5.
As you have found out, 2 lines must be added to the php.ini file:
extension=php_pdo.dll
extension=php_sqlite.dll

When you want to connect to a SQLite3 Database you do this:
$dbh = new PDO('sqlite:<path_to_DBfile>');
$results = $dbh->Query("<your_query>");
while ($row = $results->Fetch(PDO::FETCH_ASSOC)) {
// stuff
}

See http://www.php.net/manual/en/ref.pdo.php for more details.

 

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

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