SA-MP Forums Archive
argument type mismatch [MYSQL] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: argument type mismatch [MYSQL] (/showthread.php?tid=610166)



argument type mismatch [MYSQL] - OMonger - 20.06.2016

Thios is the error I am getting when compiling:

C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 1)
C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 1)

PHP код:
mysql_format(querysizeof(query), "SELECT * FROM users WHERE name = '%s'"pName); 
Please help


Re: argument type mismatch [MYSQL] - Konstantinos - 20.06.2016

The first parameter is the connection handle (what mysql_connect returned).


Re: argument type mismatch [MYSQL] - F1N4L - 20.06.2016

Quote:
Originally Posted by OMonger
Посмотреть сообщение
Thios is the error I am getting when compiling:

C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 1)
C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 1)

PHP код:
mysql_format(querysizeof(query), "SELECT * FROM users WHERE name = '%s'"pName); 
Please help
Код:
mysql_format(ConnectionDB, query, sizeof(query), "SELECT * FROM users WHERE name = '%s'", pName);



Re: argument type mismatch [MYSQL] - OMonger - 20.06.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
mysql_format(ConnectionDB, query, sizeof(query), "SELECT * FROM users WHERE name = '%s'", pName);
now getting these errors:

C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 1)
C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 3)


Re: argument type mismatch [MYSQL] - OMonger - 20.06.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
mysql_format(ConnectionDB, query, sizeof(query), "SELECT * FROM users WHERE name = '%s'", pName);
C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 1)
C:\Users\Administrator\Desktop\sa-mp\gamemodes\roleplayMYSQL.pwn(4 : error 035: argument type mismatch (argument 3)


line 48:
mysql_format(SQL_DB, query, sizeof(query), "SELECT * FROM users WHERE name = '%s'", pName);

can you help?


Re: argument type mismatch [MYSQL] - Konstantinos - 20.06.2016

I guess you have an older version which does not accept any length of the query. Best way to figure out is to open a_mysql.inc and search for native "mysql_format". Compare the parameters you have with those listed in the include file and modify it accordingly. If you still cannot get it compiled, post it here.

About the first parameter, I mentioned (not sure if you read it) is the connection handle and that is what mysql_connect returned. It should be an integer so if it still gives you an error you have probably defined it wrong. Post here how you defined "SQL_DB".


Re: argument type mismatch [MYSQL] - OMonger - 20.06.2016

Perhaps can you find me a tutorial and a link to the most recent MYSQL for SA-MP so I can create a login system?

Thanks


Re: argument type mismatch [MYSQL] - Konstantinos - 20.06.2016

Download latest version from here: https://github.com/pBlueG/SA-MP-MySQL/releases
How to use threaded queries: https://sampforum.blast.hk/showthread.php?tid=337810
Wiki (for R33+): https://sampwiki.blast.hk/wiki/MySQL/R33
Example script: https://github.com/pBlueG/SA-MP-MySQ...stem-cache.pwn
Other (tutorial): https://sampforum.blast.hk/showthread.php?tid=574714