PDA

View Full Version : error 035: argument type mismatch (help)


PiLLoW
19/04/2017, 06:12 PM
any help with this?

error:
(4530) : error 035: argument type mismatch (argument 1)

Code:
case LOS_SANTOS:
{
format(string, sizeof(string), "UPDATE server SET Gamemode = '%d' WHERE Server = '1'",LAS_VENTURAS);
mysql_query(string);
}


THANK YOU

Banditul18
19/04/2017, 06:13 PM
http://wiki.sa-mp.com/wiki/MySQL/R33#mysql_query

Why nobody look at functions parameters before use?

You are missing connection handler who goes first

PiLLoW
19/04/2017, 06:23 PM
can you please give example thank you

Yuri8
19/04/2017, 06:33 PM
Use mysql_format

PiLLoW
19/04/2017, 06:35 PM
How example please here's the Code

case LOS_SANTOS:
{
format(string, sizeof(string), "UPDATE server SET Gamemode = '%d' WHERE Server = '1'",LAS_VENTURAS);
mysql_query(string);
}

Banditul18
19/04/2017, 06:48 PM
case LOS_SANTOS:
{
mysql_format(ConnectionHandler,string, sizeof(string), "UPDATE server SET Gamemode = '%d' WHERE Server = '1'",LAS_VENTURAS);
mysql_tquery(ConnectionHandler,string,"","");
}
Mysql_tquery better for this kind of thing , the first parameter of those 2 things is ConnectionHandler that you use at mysql_connect

Ex:
ConnectionHandler = mysql_connect(...);

skuller12
19/04/2017, 06:58 PM
mysql_query(string);

try

if you have a connection mysql

mysql_query(handle, string);

http://wiki.sa-mp.com/wiki/MySQL/R33#mysql_query

and connection documentation
http://wiki.sa-mp.com/wiki/MySQL/R33#mysql_connect

and simplification

mysql_format(handle, string, sizeof(string), "UPDATE server SET Gamemode = '%d' WHERE Server = '1'",LAS_VENTURAS);
mysql_tquery(handle, string, "", "");

PiLLoW
20/04/2017, 04:40 AM
anyone can explain what to do im new in mysql

DTV
20/04/2017, 05:01 AM
What are you bumping for? You have two replies that explain what you're doing wrong and how to fix it.

PiLLoW
20/04/2017, 05:04 AM
DTV read Pm Thank you