Converted script to MYSQL -
RedWolfX - 28.09.2013
Hello, I am working on converting my script to MYSQL. But got some troubles. it refuses to connect to mysql.
This is the error I get in the server.log
Код:
Function: mysql_connect called with incorrect parameter count.
This is the mysql connect codes
pawn Код:
#define mysql_host "localhost"
#define mysql_user "samp01_db"
#define mysql_password "REMOVED"
#define mysql_database "samp01_db"
mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
First time I ever coded in mysql, any help are appreciated!
Thanks
Re: Converted script to MYSQL - Patrick - 28.09.2013
which MySQL do you use?
BlueG's one? or
StrickenKid's because every version of MySQl has got a different parameter
StrickenKid's MySQL Parameter
pawn Код:
mysql_connect(const host[], const user[], const pass[], const db[], MySQL:handle = (MySQL:0), auto_reconnect = 0);
BlueG's MySQL Parameter
pawn Код:
mysql_connect( const host[], const user[], const database[], const password[] )
Re: Converted script to MYSQL -
RedWolfX - 28.09.2013
I used BlueG's
Re: Converted script to MYSQL - Patrick - 28.09.2013
Hmm... Your
Parameter is right, did you try checking your include and plugins? check if you got the correct plugin and include.
Re: Converted script to MYSQL -
RedWolfX - 28.09.2013
I will re-download it
Re: Converted script to MYSQL - Patrick - 28.09.2013
Quote:
Originally Posted by RedWolfX
I will re-download it
|
Yes, try that.
Re: Converted script to MYSQL -
Konstantinos - 28.09.2013
From a research, it's never been posted anything related to BlueG's MySQL plugin; however, it's been posted in the past about StrickenKid's MySQL plugin.
Are you really sure that you have the include and plugin by BlueG's MySQL plugin?
Re: Converted script to MYSQL -
RedWolfX - 28.09.2013
Quote:
Originally Posted by Konstantinos
From a research, it's never been posted anything related to BlueG's MySQL plugin; however, it's been posted in the past about StrickenKid's MySQL plugin.
Are you really sure that you have the include and plugin by BlueG's MySQL plugin?
|
Yes I am sure :P Was following this tutorial:
https://sampforum.blast.hk/showthread.php?tid=305994
And it didnt work. Still same error
Re: Converted script to MYSQL -
Bit - 28.09.2013
Try using g_ConnectionHandle as mysql_connect
pawn Код:
#include <a_samp>
#include <a_mysql>
new g_ConnectionHandle;
public OnGameModeInit()
{
g_ConnectionHandle = mysql_connect("host", "user", "database", "password");// replace host with host IP, user with database username, database with database name, and password with database password
return 1;
}
Might not conflict with that error, but I think it's because you probably missed those " "
Re: Converted script to MYSQL -
RedWolfX - 28.09.2013
Quote:
Originally Posted by Bit
Try using g_ConnectionHandle as mysql_connect
pawn Код:
#include <a_samp> #include <a_mysql>
new g_ConnectionHandle;
public OnGameModeInit() { g_ConnectionHandle = mysql_connect("host", "user", "database", "password");// replace host with host IP, user with database username, database with database name, and password with database password return 1; }
Might not conflict with that error, but I think it's because you probably missed those " "
|
Did that, still same.
Код:
[16:26:47] Function: mysql_connect called with incorrect parameter count.
Although you said it wouldnt fix it