SA-MP Forums Archive
[INFO]System Registration based mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [INFO]System Registration based mysql (/showthread.php?tid=286799)



[INFO]System Registration based mysql - TheBluec0de - 30.09.2011

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 ]============================================================



Re: [INFO]System Registration based mysql - [MWR]Blood - 30.09.2011

And, what is the problem?


Re: [INFO]System Registration based mysql - TheBluec0de - 30.09.2011

to create the table storing the data as I do? an example?


Re: [INFO]System Registration based mysql - TheBluec0de - 30.09.2011

uhm ?


Re: [INFO]System Registration based mysql - CJ101 - 30.09.2011

To create tables, use phpmyadmin, or do a 'CREATE TABLE .. IF NOT EXISTS" query.


Re: [INFO]System Registration based mysql - TheBluec0de - 30.09.2011

I know I have to use phpmyadmin, but I did not understand very well how to create table, all varchar etc.


Re: [INFO]System Registration based mysql - Kingunit - 30.09.2011

http://www.tizag.com/mysqlTutorial/mysqltables.php