#define SQL_DB "utf8mb4_general_ci"
#1

I cant run my server unless this connects it to my mysql DB.
Code:
#define SQL_DB "I dont know what to put here."//
Can someone tell me what to put there.
Reply
#2

Im not MySQL guru but im pretty sure thats the database name
Reply
#3

where can I find the Database name in phpmyadmin
Reply
#4

....
Reply
#5

you were right, that is where name goes. do you know what goes here #define SQL_HOST "HERE"
Reply
#6

Code:
#define SQL_HOST "your host"
#define SQL_USER "your user"
#define SQL_DATA "your database name"
#define SQL_PASS "your user password"
And to connect, in OnGameModeInit for example:
Code:
mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
Example:
Code:
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_DATA "samp"
#define SQL_PASS ""

public OnGameModeInit()
{
    mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
    if(mysql_ping()) print("Connected to the MySQL database.");
    else print("Error while trying to connect to the MySQL database.");
    return 1;
}
Sorry if my english is bad, I'm french.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)