You are here: sqlite « PHP Language « IT news, forums, messages
sqlite

Posted by Siegfreed on 12/23/06 04:36

Problem description:

I have php version 5.1.6, but I am having troubles in running sqlite.

For example, when i run the following code:

<?php
// create new database (procedural interface)
$db = sqlite_open("db.sqlite");

// uncomment next line if you still need to create table foo
// sqlite_query($db , "CREATE TABLE foo (id INTEGER PRIMARY KEY, name
CHAR(255))");

// insert sample data
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')");

// execute query
$result = sqlite_query($db, "SELECT * FROM foo");
// iterate through the retrieved rows
while ($row = sqlite_fetch_array($result)) {
print_r($row);
/* each result looks something like this
Array
(
[0] => 1
[id] => 1
[1] => Ilia
[name] => Ilia
)
*/
}

// close database connection
sqlite_close($db);

?>

I get the following message:

Fatal error: Call to undefined function sqlite_open() in
C:\http-dir\new_db_02.htm on line 15

What the problem(s) is, or are?

 

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

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