mysql connection is dead - 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: mysql connection is dead (
/showthread.php?tid=405449)
mysql connection is dead -
pantelimonfl - 06.01.2013
I'm using the R6 plugin (because the r7 causes some troubles) and the server can't connect to the database. The only error i'm getting is:
pawn Код:
[18:53:00] >> mysql_query( Connection handle: 1 )
[18:53:00] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
The problem is that the mysql is running and when i'm trying to call mysql_num_rows() to count the account numbers, it returns -1.
Re: mysql connection is dead -
pantelimonfl - 06.01.2013
Anyone?
Re: mysql connection is dead -
mastermax7777 - 06.01.2013
your title explains the error... connect to mysql first.. usin mysql_connect()
Re: mysql connection is dead -
pantelimonfl - 07.01.2013
It's the first line in OnGameModeInit():
pawn Код:
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS ""
#define SQL_DB "samp"
pawn Код:
public OnGameModeInit()
{
///
mysql_connect(SQL_HOST,SQL_USER,SQL_PASS,SQL_DB);
}