[INFO]System Registration based mysql
#1

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 ]============================================================
Reply
#2

And, what is the problem?
Reply
#3

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

uhm ?
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)