php ve sqlite-programları ile sqlite kullanıyorum

1 Cevap php

Ben php ile sqlite kullanmaya çalışıyorum.

Bazı öğretici kullandı:

$db = sqlite_open("db.sqlite");

sqlite_query($db , "CREATE TABLE foo (id INTEGER PRIMARY KEY, name CHAR(255))");

sqlite_query($db, "INSERT INTO foo (name) VALUES ('Ilia')");
sqlite_query($db, "INSERT INTO foo (name) VALUES ('Ilia2')");
sqlite_query($db, "INSERT INTO foo (name) VALUES ('Ilia3')");

$result = sqlite_query($db, "SELECT * FROM foo");

while ($row = sqlite_fetch_array($result)) print_r($row);

It works, but file db.sqlite can't be opened by any sqlite program. And vice-versa, files that were created by sqlite programs can't be opened with php sqlite_open:

Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in ...\public_html\test\test.php on line 2

Burada sorun olabilir?

1 Cevap

Maybe it's the SQLite version?

sqlite_open() sadece yaratır / SQLite 2 veritabanları okur.

Sana sqlite: (sürüm 3) ve sqlite2: (sürüm 2) PDO sürücüleri çok daha iyi hareket etmektedir.