#define SQL_DB "utf8mb4_general_ci" - 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: #define SQL_DB "utf8mb4_general_ci" (
/showthread.php?tid=507956)
#define SQL_DB "utf8mb4_general_ci" -
AIMigboboy - 19.04.2014
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.
Re: #define SQL_DB "utf8mb4_general_ci" -
ConnorHunter - 20.04.2014
Im not MySQL guru but im pretty sure thats the database name
Re: #define SQL_DB "utf8mb4_general_ci" -
AIMigboboy - 20.04.2014
where can I find the Database name in phpmyadmin
Re: #define SQL_DB "utf8mb4_general_ci" -
AIMigboboy - 20.04.2014
....
Re: #define SQL_DB "utf8mb4_general_ci" -
AIMigboboy - 20.04.2014
you were right, that is where name goes. do you know what goes here #define SQL_HOST "
HERE"
Re : #define SQL_DB "utf8mb4_general_ci" -
Mathieu371 - 20.04.2014
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.