Feature list
Adds two natives for send and get information from database.
Use
Information store in varchar(1024). You can store any types of information like integer and use StringTo* functions after read from database, or bool just use StrEqual(text, "true", false). Can use different tables in one plugin, but be sure that different plugins don't use the same name of table on one server (except if you do it specially).
Installation
Add in you code include for SQL_Write and SQL_Read functioning.
and add dbsi.inc in include dir inside scripting dir before compiling your plugin.
Do not forget put dbsi.smx in plugins dir on server where you use plugins with SQL_Write and SQL_Read application.
CVAR/Command list
dbsi_confname — Config name from database.cfg for connect params. (Def: dbsi)
Natives
Code:
/**
* Set vaule of text to table in database.
*
* @param table Table name
* @param client Client index
* @param fmt Information for store
* @noreturn
* @error Failed to query
*/
native SQL_Write(const String:table[], client, const String:fmt[], any:...);
/**
* Get vaule of text from table in database.
*
* @param table Table name
* @param client Client index
* @param text Buffer to store information
* @param maxlength Maximum length of string buffer
* @noreturn
* @error Failed to query
*/
native SQL_Read(const String:table[], client, String:text[], maxlength);
Changelog
2014-11-27 (v1.0)