CoE Home | computing | web |

Use SQLite with PHP

As of Nov 30, 2005, the PHP CGI provided by COE for user web pages includes support for SQLite, a file-based database server.

For information on setting up PHP for your web pages, please see http://engr.oregonstate.edu/computing/web/39.

To create a SQLite file, you use the sqlite_open() function. If you don't give the file name a path, it will be created in the same directory as the script. Below is a sample code block of creating/opening the database, creating a table, adding a record, then dumping a query of the database:

For more information on SQLite, see http://www.php.net/manual/en/ref.sqlite.php or http://sqlite.org

Related Articles:

Setup a personal wiki
Using .htaccess
Make your PHP scripts ready for PHP 5
Use PHP In your ENGR web pages

Article Information:

Date Created: Nov 30, 2005
Last Modified: Thu, Jul 10, 2008 1:24 PM
Views: 2411