MySQL query does not work. Other thing:Array must be indexed
#1

The first problem.
Code:
pawn Код:
new query[128], labelstring[126];
    format(labelstring,sizeof(labelstring),"Namas Parduodamas \n Kaina:%d \nNoredamas pirkti rasyk /buyhouse",HousePrice);
    format(query,sizeof(query),"INSERT INTO houses (VirtualWorld,PosX,PosY,PosZ,Price,HouseLabel) VALUES (%d,%f,%f,%f,%d,%s)",GetPlayerVirtualWorld(playerid),x,y,z,HousePrice,labelstring);
    mysql_query(query);
Error:
pawn Код:
[16:24:25] CMySQLHandler::Query(INSERT INTO houses (VirtualWorld,PosX,PosY,PosZ,Price,HouseLabel) VALUES (0,-205.562133,1032.921630,19.945363,420,Namas Parduod) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Parduod' at line 1)

And another problem:
pawn Код:
PlayerDrugs[playerid][Preke]+=1;
Error:
pawn Код:
C:\Users\Justas\Desktop\testserver 0.3x\gamemodes\rp.pwn(3251) : error 033: array must be indexed (variable "Preke")
The thing with this is I want to add "Preke" +1,but Preke is an item that players choose from a list. So i can not know which one do i need to add to.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)