SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/09/2011, 05:28 PM   #1
TheBluec0de
Gangsta
 
TheBluec0de's Avatar
 
Join Date: Mar 2011
Posts: 569
Reputation: 12
Post [INFO]System Registration based mysql

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 ]============================================================
TheBluec0de is offline   Reply With Quote
Old 30/09/2011, 05:29 PM   #2
[MWR]Blood
High-roller
 
Join Date: Apr 2009
Posts: 2,268
Reputation: 105
Default Re: [INFO]System Registration based mysql

And, what is the problem?
__________________
[MWR]Blood is offline   Reply With Quote
Old 30/09/2011, 05:32 PM   #3
TheBluec0de
Gangsta
 
TheBluec0de's Avatar
 
Join Date: Mar 2011
Posts: 569
Reputation: 12
Default Re: [INFO]System Registration based mysql

to create the table storing the data as I do? an example?
TheBluec0de is offline   Reply With Quote
Old 30/09/2011, 05:44 PM   #4
TheBluec0de
Gangsta
 
TheBluec0de's Avatar
 
Join Date: Mar 2011
Posts: 569
Reputation: 12
Default Re: [INFO]System Registration based mysql

uhm ?
TheBluec0de is offline   Reply With Quote
Old 30/09/2011, 05:48 PM   #5
CJ101
High-roller
 
CJ101's Avatar
 
Join Date: Jan 2008
Location: RevolutionX
Posts: 1,758
Reputation: 162
Default Re: [INFO]System Registration based mysql

To create tables, use phpmyadmin, or do a 'CREATE TABLE .. IF NOT EXISTS" query.
__________________
I have left SA-MP. Thanks for a great ten years.
CJ101 is offline   Reply With Quote
Old 30/09/2011, 05:50 PM   #6
TheBluec0de
Gangsta
 
TheBluec0de's Avatar
 
Join Date: Mar 2011
Posts: 569
Reputation: 12
Default Re: [INFO]System Registration based mysql

I know I have to use phpmyadmin, but I did not understand very well how to create table, all varchar etc.
TheBluec0de is offline   Reply With Quote
Old 30/09/2011, 05:55 PM   #7
Kingunit
High-roller
 
Kingunit's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,426
Reputation: 120
Default Re: [INFO]System Registration based mysql

http://www.tizag.com/mysqlTutorial/mysqltables.php
__________________
Kingunit is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] jHouse - a MySQL based, user friendly housing system! jameskmonger Filterscripts 45 28/01/2015 01:37 PM
[Include] SiJ_Bank - MySQL based bank system! *IsBack Includes 10 26/11/2014 08:42 AM
[FilterScript] r_Register MySQL BASED Registration FS Raimis_R Filterscripts 65 03/08/2014 07:54 AM
[MySQL] Advanced Registration System Carlton Filterscripts 52 11/04/2014 07:23 AM
[FilterScript] CyberRegister - MySQL based registration script (v1.0) Laronic Filterscripts 42 11/08/2011 06:38 PM


All times are GMT. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.