downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SQLite3::createAggregate> <SQLite3::close
[edit] Last updated: Fri, 23 Mar 2012

view this page in

SQLite3::__construct

(PHP 5 >= 5.3.0)

SQLite3::__constructYeni bir SQLite3 nesnesini ilklendirdikten sonra bir SQLite veritabanını açar

Açıklama

SQLite3::__construct ( string $dosya [, int $seçenekler [, string $anahtar ]] )

Yeni bir SQLite3 nesnesini ilklendirdikten sonra dosya ile belirtilen SQLite veritabanına bir bağlantı açar. Eğer veritabanı şifreliyse anahtar ile şifresini çözmeye çalışır.

Değiştirgeler

dosya

SQLite veritabanını içeren dosyanın yolu.

seçenekler

SQLite veritabanının nasıl açılacağını belirleyen seçimlik seçenekler. Öntanımlı olarak, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE kullanılır.

  • SQLITE3_OPEN_READONLY: Veritabanı okumak için açılır.

  • SQLITE3_OPEN_READWRITE: Veritabanı hem okumak hem de yazmak için açılır.

  • SQLITE3_OPEN_CREATE: Veritabanı yoksa oluşturulur.

encryption_key

SQLite veritabanını şifrelemek/şifresini çözmek için kullanılan şifreleme anahtarı.

Dönen Değerler

İşlem başarılı olursa bir SQLite3 nesnesi döner.

Örnekler

Örnek 1 - SQLite3::__construct() örneği

<?php
$db 
= new SQLite3('mysqlitedb.db');

$db->exec('CREATE TABLE foo (bar STRING)');
$db->exec("INSERT INTO foo (bar) VALUES ('Bu bir denemedir.')");

$result $db->query('SELECT bar FROM foo');
var_dump($result->fetchArray());
?>



SQLite3::createAggregate> <SQLite3::close
[edit] Last updated: Fri, 23 Mar 2012
 
add a note add a note User Contributed Notes SQLite3::__construct
Anonymous 28-Apr-2012 11:32
Construct will fail if \ backslash is used in the database path,
use / forward slash instead for directory separators.
anton dot grbin at carnet dot hr 17-Apr-2012 08:27
An exception will be thrown if __construct fails.

PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file' in ...
bohwaz 16-May-2011 10:59
$encryption_key and all encryption features will be enabled only if the SQLite encryption module is installed. It's a proprietary, costly module. So if it's not present, supplying an encryption key will have absolutely no effect.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites