diff --git a/.gitignore b/.gitignore index f330e7c..8d37fcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test_config.json tests/simpletest/* +index.html diff --git a/README.md b/README.md index 8ca1451..7011b1e 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,28 @@ Query uses the same interface as CodeIgniter's [Active Record class](http://code To retreive the results of a query, use the PDO methods: [fetch](http://php.net/manual/en/pdostatement.fetch.php) and / or [fetchAll](http://php.net/manual/en/pdostatement.fetchall.php). +An example of a moderately complex query: + + $query = $db->select('id, key as k, val') + ->from('table t') + ->where('k >', 3) + ->or_where('id !=' 5) + ->order_by('val', 'DESC') + ->limit(3, 1) + ->get(); + +This will generate a query similar to (with this being the output for a Postgres database): + + SELECT "id", "key" AS "k", "val" + FROM "table" "t" + WHERE "k" > ? + OR "id" != ? + ORDER BY "val" DESC + LIMIT 3 OFFSET 1 + + +To retreive the results of a query, use the PDO method [fetch](http://php.net/manual/en/pdostatement.fetch.php) and/or[fetchAll](http://php.net/manual/en/pdostatement.fetchall.php). + $query = $db->get('table_name'); $results = $query->fetchAll(PDO::FETCH_ASSOC); \ No newline at end of file diff --git a/tests/test_dbs/FB_TEST_DB.FDB b/tests/test_dbs/FB_TEST_DB.FDB index d59c0ec..b725d4d 100755 Binary files a/tests/test_dbs/FB_TEST_DB.FDB and b/tests/test_dbs/FB_TEST_DB.FDB differ