Problem with sql
#1

Код:
[21:15:05] CMySQLHandler::Query(UPDATE PlayerDealership SET Lock = 1 WHERE Owner = 'Tan') - 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 = 1 WHERE Owner = 'Tan'' at line 1)
[21:15:05] >> mysql_query( Connection handle: 1 )
[21:15:05] CMySQLHandler::Query(UPDATE PlayerDealership2 SET Lock = 1 WHERE Owner = 'Tan') - 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 = 1 WHERE Owner = 'Tan'' at line 1)
[21:15:05] >> mysql_query( Connection handle: 1 )
[21:15:05] CMySQLHandler::Query(UPDATE PlayerDealership3 SET Lock = 1 WHERE Owner = 'Tan') - 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 = 1 WHERE Owner = 'Tan'' at line 1)
[21:15:05] >> mysql_query( Connection handle: 1 )
[21:15:05] CMySQLHandler::Query(UPDATE PlayerDealership4 SET Lock = 1 WHERE Owner = 'Tan') - 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 = 1 WHERE Owner = 'Tan'' at line 1)
[21:15:05] >> mysql_query( Connection handle: 1 )
[21:15:05] CMySQLHandler::Query(UPDATE PlayerDealership5 SET Lock = 1 WHERE Owner = 'Tan') - 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 = 1 WHERE Owner = 'Tan'' at line 1)
[21:15:05] >> mysql_store_result( Connection handle: 1 )
pawn Код:
format(str,sizeof(str),"UPDATE PlayerDealership SET Lock = 1 WHERE Owner = '%s'",Nam);
    mysql_query(str);
    format(str,sizeof(str),"UPDATE PlayerDealership2 SET Lock = 1 WHERE Owner = '%s'",Nam);
    mysql_query(str);
    format(str,sizeof(str),"UPDATE PlayerDealership3 SET Lock = 1 WHERE Owner = '%s'",Nam);
    mysql_query(str);
    format(str,sizeof(str),"UPDATE PlayerDealership4 SET Lock = 1 WHERE Owner = '%s'",Nam);
    mysql_query(str);
    format(str,sizeof(str),"UPDATE PlayerDealership5 SET Lock = 1 WHERE Owner = '%s'",Nam);
    mysql_query(str);
Reply
#2

Try to enclose Owner with backticks (`). `Owner`
Reply
#3

Enclose the Lock field with back ticks.

pawn Код:
format(str,sizeof(str),"UPDATE PlayerDealership SET `Lock` = 1 WHERE Owner = '%s'",Nam);
    mysql_query(str);
Pretty sure lock is a MySQL function and therefore it may screw up your query if you don't use backticks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)