SA-MP Forums Archive
Invalid Expression - 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: Invalid Expression (/showthread.php?tid=617929)



Invalid Expression - yvoms - 28.09.2016

please help me track the issue hehe.

I've got a check VIP script however it's giving me a weird error.
Код:
CheckVIP(playerid)
{
    mysql_format(mysql, query, sizeof(query), "SELECT Expiry FROM VIP WHERE PlayerID = %d", pData[playerid][ID]);
    mysql_tquery(mysql, query, "f_CheckVIP", "i", playerid);
}
however, its returning me the following errors.
Код:
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
On the line Mysql_format(MySQL, query, sizeof(query, "SELECT Expiry FROM VIP WHERE PlayerID = %d, pData[playerid][ID]);

I have no idea why it's giving the error I taught I did this all correct.


Re: Invalid Expression - Kaliber - 28.09.2016

Where & how you defined query?


Re: Invalid Expression - PrO.GameR - 28.09.2016

There is no query string defined.. However it shouldn't throw that error tho (it should give the non defined var error) so idk.


Re: Invalid Expression - iLearner - 28.09.2016

mysql_format(1, query, sizeof(query), "SELECT Expiry FROM VIP WHERE PlayerID = %d", pData[playerid][ID]);

Try that.


Re: Invalid Expression - yvoms - 29.09.2016

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Where & how you defined query?
I've defined the query however it shouldn't make a difference.


Re: Invalid Expression - SickAttack - 29.09.2016

Why don't you use format instead? Use the %q specifier to escape user inputs.