Version 1.4.1, TODO functions and wrapper to query_goto

This commit is contained in:
Kevin Puertas
2017-09-20 15:42:11 +02:00
parent db89edd4ab
commit aedf9bf952
2 changed files with 40 additions and 83 deletions

View File

@@ -1,4 +1,4 @@
# DBWrapper - Version 1.4
# DBWrapper - Version 1.4.1
This script is a simple wrapper for SQLite3, MySQL and PgSQL, for make possible to use different BD systems without changing the functions.
@@ -21,25 +21,27 @@ This script is a simple wrapper for SQLite3, MySQL and PgSQL, for make possible
```php
//Does a query (array, or false if error)
array dbw_query (resource $conn, string $query);
resource dbw_query (resource $conn, string $query);
//This does a (non interactive) multiquery. Its used for load from a file/script for example.
bool dbw_multi_query(resource $conn, string $multiquery);
//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]);
resource dbw_query_fetch_array (resource $conn,string $query[, string $typearray]);
```
* Using result of a query
```php
//Fetch a row. ($typearray optional, see below)
array dbw_fetch_array (resource $conn,array $result[, string $typearray]);
array dbw_fetch_array (resource $conn,resource $result[, string $typearray]);
//Wrappers of dbw_fetch_array with row or assoc arguments
array dbw_fetch_row(resource $conn,array $result);
array dbw_fetch_assoc(resource $conn,array $result);
//Goto X result of a query. If row is not specified, will be first row, 0
bool array dbw_query_goto(resource $conn,array $result[,int $row]) ;
array dbw_fetch_row(resource $conn,resource $result);
array dbw_fetch_assoc(resource $conn,resource $result);
//Goto X result of a query (Not retrieve it). If row is not specified, will be first row, 0
bool dbw_query_goto(resource $conn,resource $result[,int $row]);
// Wrappers to dbw_query_goto are dbw_data_seek and dbw_result_seek for compatibility
//Return number of results of a query
int dbw_num_rows(resource $conn, array $result);
int dbw_num_rows(resource $conn, resource $result);
```
* Without a query