30.09.2011, 17:28
I'm doing a register system with mysql, and right up to here? I have to connect the database
Code:
//=======[ FS ]================================================================= #define FILTERSCRIPT //=======[ INCLUDE ]============================================================ #include <a_samp> #include <a_mysql> //=======[ MYSQL-S ]============================================================ #define SQL_HOST "this is a host" #define SQL_USER "this is a user" #define SQL_PASS "this is a password" #define SQL_DB "this is a database" //=======[ FS-S ]=============================================================== #define NAMEFS "system mysql" #define UPDATEFS "00/00/0000" #define VERSIONFS "v0.1" #define LINEFS "00000" //=======[ ONFILTERSCRIPTINIT ]================================================= public OnFilterScriptInit() { mysql_debug(1); print ( "\n[===========================================]"); printf( " %s", NAMEFS); printf( " Date Update: %s", UPDATEFS); printf( " Version: %s", VERSIONFS); printf( " Line FS: %s", LINEFS); print ( " Start FilterScript"); print ( "[===========================================]\n"); mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS); if(mysql_ping()>=1) { print(" [MySQL]: Connected succefully"); } else { print(" [MySQL]: Disconnected succefully"); SendRconCommand("exit"); } return 1; } //=======[ ONFILTERSCRIPTEXIT ]================================================= public OnFilterScriptExit() { print ( "\n[===========================================]"); printf( " %s", NAMEFS); printf( " Date Update: %s", UPDATEFS); printf( " Version: %s", VERSIONFS); printf( " Line FS: %s", LINEFS); print ( " Stop FilterScript"); print ( "[===========================================]\n"); mysql_close(); return 1; } //=======[ END FS ]============================================================