server-php-sqlite-demo-connect.php / php
<?php // create new database (procedural interface) // 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 ('Ilia2')"); sqlite_query(// execute query result = sqlite_query(// iterate through the retrieved rows while (row = sqlite_fetch_array(row); /* each result looks something like this Array ( [0] => 1 [id] => 1 [1] => Ilia [name] => Ilia ) */ } // close database connection sqlite_close(
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.