Raised This Month: $32 Target: $400
 8% 

[Any] Database Simple Interface (v1.0, 2014-11-27)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Plugin ID:
4428
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows easily store information in databases
    Old 11-27-2014 , 14:53   [Any] Database Simple Interface (v1.0, 2014-11-27)
    Reply With Quote #1

    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.
    Code:
    #include <dbsi>
    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)
    • Initial release.
    Attached Files
    File Type: sp Get Plugin or Get Source (dbsi.sp - 648 views - 5.0 KB)
    File Type: inc dbsi.inc (1.4 KB, 259 views)

    Last edited by Kailo; 11-27-2014 at 15:00.
    Kailo is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 11-27-2014 , 16:41   Re: [Any] Database Simple Interface (v1.0, 2014-11-27)
    Reply With Quote #2

    It's as simple as cool. I would like to see more options in dbsi config, so we can use more DB connects at once, or at least command/option to reload database config and reconnect to another DB if needed. GJ
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 22:17.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode