mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
New DBI
This commit is contained in:
parent
259a9d70ec
commit
f7e0baa45e
@ -28,41 +28,40 @@ native dbi_connect(_host[], _user[], _pass[], _dbname[], _error[]="", _maxlength
|
|||||||
* If it fails, it will return a number BELOW ZERO (0)
|
* If it fails, it will return a number BELOW ZERO (0)
|
||||||
* If zero, it succeeded with NO RETURN RESULT.
|
* If zero, it succeeded with NO RETURN RESULT.
|
||||||
* If greater than zero, make sure to call dbi_free_result() on it!
|
* If greater than zero, make sure to call dbi_free_result() on it!
|
||||||
|
* The return is a handle to the result set
|
||||||
*/
|
*/
|
||||||
native dbi_query(_sql, _query[], {Float,_}:...);
|
native dbi_query(_sql, _query[], {Float,_}:...);
|
||||||
|
|
||||||
/* Returns 0 on failure or End of Results.
|
/* Returns 0 on failure or End of Results.
|
||||||
* Advances result pointer by one row.
|
* Advances result pointer by one row.
|
||||||
*/
|
*/
|
||||||
native dbi_nextrow(_sql, _result=1);
|
native dbi_nextrow(_result=1);
|
||||||
|
|
||||||
/* Gets a field by number. Returns 0 on failure.
|
/* Gets a field by number. Returns 0 on failure.
|
||||||
* Although internally fields always start from 0,
|
* Although internally fields always start from 0,
|
||||||
* This function takes fieldnum starting from 1.
|
* This function takes fieldnum starting from 1.
|
||||||
|
* No extra params: returns int
|
||||||
|
* One extra param: returns Float: byref
|
||||||
|
* Two extra param: Stores string with length
|
||||||
*/
|
*/
|
||||||
native dbi_field(_sql, _result, _fieldnum, _dest[], _maxlen);
|
native dbi_field(_result, _fieldnum, {Float,_}:... );
|
||||||
|
|
||||||
/* Returns a field by number, as a number.
|
/* Gets a field by number. Returns 0 on failure.
|
||||||
*/
|
|
||||||
native dbi_field_num(_sql, _result, _fieldnum);
|
|
||||||
|
|
||||||
/* Gets a field by name. Returns 0 on failure.
|
|
||||||
* Although internally fields always start from 0,
|
* Although internally fields always start from 0,
|
||||||
* This function takes fieldnum starting from 1.
|
* This function takes fieldnum starting from 1.
|
||||||
|
* No extra params: returns int
|
||||||
|
* One extra param: returns Float: byref
|
||||||
|
* Two extra param: Stores string with length
|
||||||
*/
|
*/
|
||||||
native dbi_result(_sql, _result, _fieldnum, _dest[], _maxlen);
|
native dbi_result(_result, _field[], {Float,_}:... );
|
||||||
|
|
||||||
/* Returns a field by name, as a number.
|
|
||||||
*/
|
|
||||||
native dbi_result_num(_sql, _result, _fieldnum);
|
|
||||||
|
|
||||||
/* Returns the number of rows returned from a query
|
/* Returns the number of rows returned from a query
|
||||||
*/
|
*/
|
||||||
native dbi_num_rows(_sql, _result);
|
native dbi_num_rows(_result);
|
||||||
|
|
||||||
/* Frees memory used by a result handle. Do this or get memory leaks.
|
/* Frees memory used by a result handle. Do this or get memory leaks.
|
||||||
*/
|
*/
|
||||||
native dbi_free_result(_sql, _result);
|
native dbi_free_result(_result);
|
||||||
|
|
||||||
/* Closes a database handle. Internally, it will also
|
/* Closes a database handle. Internally, it will also
|
||||||
* mark the handle as free, so this particular handle may
|
* mark the handle as free, so this particular handle may
|
||||||
|
Loading…
Reference in New Issue
Block a user