Problem with mysql query
#1

Hi everyone !

I have a problem with my bizz system. For create my bizz system, i am inspired by my house system, with my house system there is not problem.

Command for create a bizz:

pawn Код:
CMD:creerbizz(playerid, params[])
{
        if(PlayerInfo[playerid][admin] < ADMING) { return SendClientMessage(playerid, ROUGEADMIN,"Vous n'кtes pas membre de l'administration ou vous n'avez pas le rang nйcessaire pour utiliser cette commande."); }
        new str[64], typeb, nomb[128], string[256], query[1028], Float:ssx, Float:ssy, Float:ssz, prix, interieur1, Float:xpos, Float:ypos, Float:zpos;
        if(sscanf(params, "dddfffs[128]", typeb, prix, interieur1, xpos, ypos, zpos, nomb))
        {
            SendClientMessage(playerid, CMDBLEU,"ARP:"BLANC1" /creermaison [type] [prix] [int] [intx] [inty] [intz] [nom]");
            SendClientMessage(playerid, CMDBLEU,"Type de bizz:"BLANC1"1: Magasin (24/7), 2: Magasin de vкtements, 3: Essence, 4: Coiffeur, 5: Bar");
            SendClientMessage(playerid, BLANC,"6: Tabac, 7: Telephone, 8: Electricitй, 9: Meubles, 10: Ammunation, 11: Restaurant/Fastfood");
            return 1;
        }
        GetPlayerPos(playerid, ssx, ssy, ssz);
        new bid = GetFreeBizzID();
        if(bid == -1) { return SendClientMessage(playerid, ROUGEADMIN,"Limite de bizzs atteinte."); }
        format(query, sizeof(query), "INSERT INTO bizz(bnom, bx, by, bz, bint, bintx, binty, bintz, bprix, btype, bvente) VALUES ('%s', '%f', '%f', '%f', '%d', '%f', '%f', '%f', '%d', '%d', 1)", nomb, ssx, ssy, ssz, interieur1, xpos, ypos, zpos, prix, typeb);
        mysql_query(query);
        BizzInfo[bid][bx]=ssx, BizzInfo[bid][by]=ssy, BizzInfo[bid][bz]=ssz;
        BizzInfo[bid][bintx]=xpos, BizzInfo[bid][binty]=ypos, BizzInfo[bid][bintz]=zpos, BizzInfo[bid][bint]=interieur1;
        BizzInfo[bid][bvente]=1, BizzInfo[bid][bprix]=prix;
        format(BizzInfo[bid][bnom], 128, "%s", nomb);
        bizzpick[bid]=CreatePickup(BIZZVENTE, TYPEBIZZ, BizzInfo[bid][bx], BizzInfo[bid][by], BizzInfo[bid][bz], 0);
        format(string, sizeof(string),"Bizz ID: "BLANC1"%d\n"COULEURBIZZ10"Nom: "BLANC1"%s\n"COULEURBIZZ10"Propriйtaire: "BLANC1"En vente\n"COULEURBIZZ10"Prix: "BLANC1"%d$", bid, BizzInfo[bid][bnom], BizzInfo[bid][bprix]);
        bizztext[bid]=Create3DTextLabel(string, COULEURBIZZ1, BizzInfo[bid][bx], BizzInfo[bid][by], BizzInfo[bid][bz], 5.0, 0, 0);
        BizzInfo[bid][bporte]=1;
        format(str, sizeof(str),"%s vient de crйer un bizz ID: %d.", PlayerName(playerid), bid);
        SendAdminMessage(str);
        return 1;
}
Quote:

[09:40:38] CMySQLHandler::Query(INSERT INTO bizz(bnom, bx, by, bz, bint, bintx, binty, bintz, bprix, btype, bvente) VALUES ('.', '-414.490020', '1163.395385', '2.686604', '10', '10.000000', '10.000000', '10.000000', '10', '0', 1)) - 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 'by, bz, bint, bintx, binty, bintz, bprix, btype, bvente) VALUES ('.', '-414.4900' at line 1)

Thanks for help and sorry for my bad english.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)