Mysql format Error - 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 format Error (
/showthread.php?tid=614412)
Mysql format Error -
cyberlord - 08.08.2016
Hello guys i just start making my new server and face a problem with a mysql , i download a R6 mysql plugin , and now start making a registration and login system , but got error this error :
PHP код:
C:\Users\Winfows\Desktop\samp 037\gamemodes\GM.pwn(119) : error 017: undefined symbol "mysql_format"
C:\Users\Winfows\Desktop\samp 037\gamemodes\GM.pwn(119) : warning 202: number of arguments does not match definition
C:\Users\Winfows\Desktop\samp 037\gamemodes\GM.pwn(119) : warning 202: number of arguments does not match definition
C:\Users\Winfows\Desktop\samp 037\gamemodes\GM.pwn(119) : warning 202: number of arguments does not match definition
C:\Users\Winfows\Desktop\samp 037\gamemodes\GM.pwn(120) : error 035: argument type mismatch (argument 1)
i have included plugin into server.cfg and its shows successfully loaded , and also pawn include a_mysql
PHP код:
#include <a_samp>
#include <core>
#include <a_mysql>
#pragma tabsize 0
and here is my onplayerconnect account check code :
PHP код:
/////ACCOUNT CHECK//////////
new query[128];
GetPlayerName(playerid, Name[playerid], 24);
GetPlayerIp(playerid, IP[playerid], 16);
mysql_format(sqlconnect, query, sizeof(query),"SELECT `password`, `id` FROM `users` WHERE `username` = '%e' LIMIT 1", Name[playerid]);
mysql_query(sqlconnect, query, "OnAccountCheck", "i", playerid);
i haven't done samp coding long time but for me its seems everything okay do not know why mysql_format are undefined , please help
Re: Mysql format Error -
Dejan12345 - 08.08.2016
add in top of your script #define mysql_format 1312
Re: Mysql format Error -
cyberlord - 08.08.2016
Quote:
Originally Posted by Dejan12345
add in top of your script #define mysql_format 1312
|
i think that should be done by plugin and include
Re: Mysql format Error -
Fairuz - 08.08.2016
Don't even listening to him..
'mysql_format' was added on mysql r33+,you should download the newest one.(r39-5)
Re: Mysql format Error -
d1git - 08.08.2016
https://github.com/pBlueG/SA-MP-MySQ...ases/tag/R39-5
Re: Mysql format Error -
Sanady - 08.08.2016
Код:
format(query, sizeof(query),"SELECT `password`, `id` FROM `users` WHERE `username` = '%s' LIMIT 1", Name[playerid]); // %e changed to %s
mysql_query(query, "OnAccountCheck", "i", playerid);
I think this should work, I am user of R6 so try this.
Re: Mysql format Error -
Shinja - 08.08.2016
Quote:
Originally Posted by cyberlord
PHP код:
mysql_query(sqlconnect, query, "OnAccountCheck", "i", playerid);
|
This should be a threaded query
PHP код:
mysql_tquery(sqlconnect, query, "OnAccountCheck", "i", playerid);
Re: Mysql format Error -
AndySedeyn - 08.08.2016
Quote:
Originally Posted by Sanady
Код:
format(query, sizeof(query),"SELECT `password`, `id` FROM `users` WHERE `username` = '%s' LIMIT 1", Name[playerid]); // %e changed to %s
mysql_query(query, "OnAccountCheck", "i", playerid);
I think this should work, I am user of R6 so try this.
|
If you want SQL injections to be possible, sure. At least sanitize your database inputs!