argument type mismatch [MYSQL]
#1

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
Reply
#2

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

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);
Reply
#4

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)
Reply
#5

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?
Reply
#6

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".
Reply
#7

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
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)