From 26f3474987023acd4ca647bbcb127df37891fe69 Mon Sep 17 00:00:00 2001 From: JKA Network Date: Wed, 20 Sep 2017 12:38:40 +0000 Subject: [PATCH] Update README.md --- README.md | 82 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 5f8ffd6..1f08471 100644 --- a/README.md +++ b/README.md @@ -4,45 +4,55 @@ This script is a simple wrapper for SQLite3, MySQL and PgSQL, for make possible ## Avalible functions: * To connect -```php -//$server is location in SQLite3 -resource dbw_connect (string $tdb,string $server[,string $database, string $user,string $password]); -``` + + ```php + //$server is location in SQLite3 + resource dbw_connect (string $tdb,string $server[,string $database, string $user,string $password]); + ``` + * To close -```php - //Closes connection -bool dbw_close (resource $conn); -``` + + ```php + //Closes connection + bool dbw_close (resource $conn); + ``` + * Queries -```php -//Does a query -mixed dbw_query (resource $conn, string $query); -//This does a multiquery without returning nothing. Its used for load from a file/script -bool dbw_multi_query(resource $conn, string $multiquery); -//Fetch a row. ($typearray optional, see below) -array dbw_fetch_array (resource $conn,resource $result[, string $typearray]); -//This do a query and fetch array, all in one function($typearray optional, see below) -array dbw_query_fetch_array (resource $conn,string $query[, string $typearray]); -``` + + ```php + //Does a query + mixed dbw_query (resource $conn, string $query); + //This does a multiquery without returning nothing. Its used for load from a file/script + bool dbw_multi_query(resource $conn, string $multiquery); + //Fetch a row. ($typearray optional, see below) + array dbw_fetch_array (resource $conn,resource $result[, string $typearray]); + //This do a query and fetch array, all in one function($typearray optional, see below) + array dbw_query_fetch_array (resource $conn,string $query[, string $typearray]); + ``` + * Using result of a query -```php -//Wrappers of dbw_fetch_array with row or assoc arguments -array dbw_fetch_row(resource $conn,resource $result); -array dbw_fetch_assoc(resource $conn,resource $result); -//Goto X result of a query. If row is not specified, will be first row, 0 -bool array dbw_query_goto(resource $conn,resource $result[,int $row]) ; -//Return number of results of a query -int dbw_num_rows(resource $conn, resource $result); -``` + + ```php + //Wrappers of dbw_fetch_array with row or assoc arguments + array dbw_fetch_row(resource $conn,resource $result); + array dbw_fetch_assoc(resource $conn,resource $result); + //Goto X result of a query. If row is not specified, will be first row, 0 + bool array dbw_query_goto(resource $conn,resource $result[,int $row]) ; + //Return number of results of a query + int dbw_num_rows(resource $conn, resource $result); + ``` + * Without a query -```php -// Escapes conflictive chars for inserting into database -string dbw_escape_string(resource $conn,string $string); -//Returns last insert ID -int dbw_last_id(resource $conn); -//Alias of dbw_last_id -int dbw_insert_id(resource $conn); -``` + + ```php + // Escapes conflictive chars for inserting into database + string dbw_escape_string(resource $conn,string $string); + //Returns last insert ID + int dbw_last_id(resource $conn); + //Alias of dbw_last_id + int dbw_insert_id(resource $conn); + ``` + * Important details ``` @@ -52,7 +62,7 @@ int dbw_insert_id(resource $conn); -PostgreSQL/PgSQL/pg -> PostgreSQL $conn is the connection stablished in dbw_connect (ie. $conn = dbw_connect('sqlite','file.sqlite')) - + $typearray is the form of array is returned, and not writed is default: -ASSOC -> Associative indexes -NUM -> Numeric indexes