Help with creating a MYSQL Database
#1

Hey everyone, I've been trying to add a MYSQL system to my server and I've been using the tutorial [HIC]TheKiller made. However, when I got up to this step, the gamemode shows some errors and doesn't compile.


Код:
public OnGameModeInit()
{
    mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
    mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(41), score INT(20), money INT(20), IP VARCHAR(16) )");
    //Fields:
    //Field Name - Use - Type
    //user- Player Name - String
    //password- Players password - String
    //score - Players score - int
    //money - Players Cash - int
    //IP - Players IP - int
    return 1;
}
After I added this to OnGameModeInit(), it gave me an error saying: error 035: argument type mismatch (argument 1)

https://sampforum.blast.hk/showthread.php?tid=159785
Reply
#2

Go into phpmyadmin or navicat

hit new under databases, create your desired tables
way easiser tbh

then connect!!
pawn Код:
new connection;

public OnGameModeInit()
{
    connection = mysql_connect(MySQL_Host, MySQL_Username, MySQL_Database, MySQL_Password);
    return 1;'
}
I find it easier to just create the tables than put them under OnGameModeInIt.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)