14.04.2011, 16:56
Hi guys.
I want to make a server with a MySQL connection.
I'm using this plugin: SA:MP MySQL Plugin
I got this now...
Includes & defines:
Other...
And this in the dialogcode:
But the problem is that in the other pieces of code he doesn't know what "connection" is.
Errors:
If i put "new MySQL:connection = mysql_init(LOG_ONLY_ERRORS, 1);" in the defines, pawno will crash.
Help!
I want to make a server with a MySQL connection.
I'm using this plugin: SA:MP MySQL Plugin
I got this now...
Includes & defines:
Код:
#include <mysql> #define MYSQL_RESULT_LOGIN 1 #define MYSQL_RESULT_REGISTER 2
Код:
public OnGameModeInit() { new MySQL:connection = mysql_init(LOG_ONLY_ERRORS, 1); mysql_connect("host", "username", "password", "database", connection); //I changed the host, username, password and database into default. return 1; } public OnPlayerDisconnect(playerid, reason) { mysql_close(connection); return 1; }
Код:
mysql_query_array("SELECT * FROM `users` WHERE `username` = 'pName' LIMIT 0,1", MYSQL_RESULT_LOGIN, {playerid}, connection);
Errors:
Код:
C:\SAMP Server\Ultimate Stuntages\filterscripts\Zadmin1-MySQL.pwn(242) : error 017: undefined symbol "connection" C:\SAMP Server\Ultimate Stuntages\filterscripts\Zadmin1-MySQL.pwn(282) : error 008: must be a constant expression; assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
Help!