roberts
Group: Members
Posts: 4983
Joined: Oct. 2003 |
|
Posted: Oct. 25 2004,18:20 |
|
OK, You have encouraged me to post this. Remember I wrote before there was an official php interface to sqlite. I tried to make it look and work like the mysql interface at that time.
I have re-posted php.tar.gz in the repository. It includes my simple sqlite interface library.
The following is an ultra simple example: From /home/dsl create a database and table $ sqlite db > create table addressbook(name,address,csz,phone); > insert into addressbook values("Robert","123 Third","90210","123-555-1234"); > select * from addressbook; > .exit
Next install php.tar.gz via the mydsl system. Then start Monkey
Then in /opt/monkey/htdocs make a simple test.php <? require "sqlite.php" $db = "/home/dsl/db"; sqlite_connect($db) or die("Count not connect to database"); $query = "select * from addressbook"; $myResult = sqlite_query($query,$db) or die("Query Failed"); $myRow = sqlite_fetch_array($myResult); $name = $myRow["name"]; ?> <HTML> <title>Test Sqlite Interface</title> <body> <? print $name; ?> </body> </html>
Have Fun. If you improve my library, please let me know.
|