Query not working..
#1

Why this query is not working?

pawn Код:
command(test, playerid, params[])
{
    new query[100];
    format(query, sizeof(query),"UPDATE vehicles SET lock = %d WHERE id = %d",0,61);
    mysql_query(query);
    return 1;
}
EDIT: I'm using BlueG plugin the version is R6.

EDIT: Error from Debug file:
Quote:

[13:51:49] CMySQLHandler::Query(UPDATE vehicles SET lock = 0 WHERE id = 61) - 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 'lock = 0 WHERE id = 61' at line 1)

Reply
#2

There must be no "lock" comumn in your database.
Reply
#3

Quote:

id

model

color1

color2

x

y

z

a

name

lock

owner

spawned

destroyed

licenses

engine

type

Mysql structure
Reply
#4

Sometimes error happen when you put a MySQL Specifier in place of an identifier.

Try this

"UPDATE 'vehicles' SET 'lock' = '%d'WHERE id = '%d'"
Reply
#5

Quote:
Originally Posted by Yashas
Посмотреть сообщение
Sometimes error happen when you put a MySQL Specifier in place of an identifier.

Try this

"UPDATE 'vehicles' SET 'lock' = '%d'WHERE id = '%d'"
I did that now and didnt work again.
Reply
#6

try this
pawn Код:
command(test, playerid, params[])
{
    new query[100];
    new ids;
    ids=61;
    format(query, sizeof(query), "UPDATE `vehicles` SET lock = '0' WHERE id = '%d'",ids);
    mysql_query(query);

    return 1;
}
Or this if 1 does not work
pawn Код:
command(test, playerid, params[])
{
     mysql_query("UPDATE `vehicles` SET lock = '0' WHERE id = '61' ");
    return 1;
}
Reply
#7

Quote:
Originally Posted by Lionel
Посмотреть сообщение
try this
pawn Код:
command(test, playerid, params[])
{
    new query[100];
    new ids;
    ids=61;
    format(query, sizeof(query), "UPDATE `vehicles` SET lock = '0' WHERE id = '%d'",ids);
    mysql_query(query);
    return 1;
}
Not working.
Reply
#8

and this?
pawn Код:
command(test, playerid, params[])
{
     mysql_query("UPDATE `vehicles` SET lock = '0' WHERE `id` = '61' ");
    return 1;
}
Reply
#9

Quote:
Originally Posted by Lionel
Посмотреть сообщение
and this?
pawn Код:
command(test, playerid, params[])
{
     mysql_query("UPDATE `vehicles` SET lock = '0' WHERE id = '61' ");
    return 1;
}
Doesnt work fuck
Reply
#10

pawn Код:
command(test, playerid, params[])
{
     mysql_query("UPDATE `vehicles` SET lock = '0' WHERE `id` = '61' ");
    return 1;
}
and this? if this does not work i give up ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)