What's the problem?
#1

Code:
public OnGameModeInit()
{
    if(mysql_connect(SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE, sqlConnection, 1))
    {
		printf("[DATABASE]: Connection failed to the database '%s'.", SQL_DATABASE);
	}
	else
	{
		printf ("[MYSQL]: Connection established to database '%s'.", SQL_DATABASE);
	}
	mysql_log(ERROR | WARNING);
    return true;
}
Of course I have my SQL info defined. sqlConnection is defined as
new MySQLqlConnection
4 errors on one line:
Code:
    if(mysql_connect(SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE, sqlConnection, 1))
invalid expression assumed zero
expression has no effect
The fucks going on?
Reply
#2

Show us the definitions of SQL_HOST, SQL_USER, SQL_PASSWORD, and SQL_DATABASE.
Reply
#3

Quote:
Originally Posted by Crayder
View Post
Show us the definitions of SQL_HOST, SQL_USER, SQL_PASSWORD, and SQL_DATABASE.
Code:
#define SQL_HOST = "localhost"
#define SQL_USER = "root"
#define SQL_DATABASE = "Test1"
#define SQL_PASSWORD = ""

new MySQL:sqlConnection;
Reply
#4

Quote:
Originally Posted by Wavybone
View Post
Code:
#define SQL_HOST = "localhost"
#define SQL_USER = "root"
#define SQL_DATABASE = "Test1"
#define SQL_PASSWORD = ""

new MySQL:sqlConnection;
wrong define usage, use this to fix your problem
Code:
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_DATABASE "Test1"
#define SQL_PASSWORD ""
but you have used wrong parameters in your "mysql_connect"

use this
Code:
    sqlConnection = mysql_connect(SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE, MySQLOpt:1)
or check out this tutorial https://sampwiki.blast.hk/wiki/MySQL_Tutorial
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)