vp_sql

Table of Contents
Functions
Differences in SQL
Features
Installation
Using

vpSQL is a flatfile, comma delimited database which utilizes a subset of SQL for interaction. In developing vpSQL I wanted to mimic php's mySQL functions mysql_query and mysql_fetch_array. This is accomplished with vp_query and vp_fetch_array as well as a couple of others.

Functions:

Top

The differences with normal sql are:

Top

Features of vp_sql

Top

Installation

Installation is relatively simple. create a directory which will be your database directory. On some servers php does not have write permision. If this is the case you must chmod the database directory to 777.
Then change the first variable in the script "$DBname" to point to the database directory relative to the root of your site, with leading and trailing slashes. For example if you created your database named data in a dirctory named admin which is one level up from your root directory you would set this variable to /admin/data/. All tables which you create will be stored and accessed automaticaly in this directory. You should remember that this is a text database and as such can be read by any one who has acess to the database directory. On apache servers you can password protect the directory which will make it fairly secure.

Top

Using vp_sql

Once you are set up and if you are at all familiar with sql and php then using vp_sql should be simple. Just include the vp_sql.php in your script before you call any of the functions. Be sure to read the functions section and especialy the section on differences between vp_sql and normal sql. The difference are minor but could save you from having a very bad day. In addition it should be noted that any attempt to assign a vaue to the vpid autoinc field will cause an error and terminate the sql statement. This field is read only.

Top