• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Db query error, i don't undestood PLEASE HELP

Nubaza

LUA Scripter
Joined
Jun 5, 2011
Messages
337
Solutions
1
Reaction score
23
Location
Chile
That's my function globalevent onTImer:

function onTimer()
db.executeQuery('INSERT IGNORE INTO `player_storage` SELECT `id`, 2423, 1 FROM `players` WHERE `online` = 0 ON DUPLICATE KEY UPDATE `value` = 1')
db.executeQuery('INSERT IGNORE INTO `player_storage` SELECT `id`, 2425, 1 FROM `players` WHERE `online` = 0 ON DUPLICATE KEY UPDATE `value` = 0')
local a = getPlayersOnline()
for b = 1, #a do
doCreatureSetStorage(a, 2423, 1)
doCreatureSetStorage(a, 2425, 0)
end
return true
end


I got this error and didn't work anything


[04/01/2014 13:54:00] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "IGNORE": syntax error (INSERT IGNORE INTO "player_storage" SELECT "id", 2423, 1 FROM "players" WHERE "online" = 0 ON DUPLICATE KEY UPDATE "value" = 1)
[04/01/2014 13:54:00] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "IGNORE": syntax error (INSERT IGNORE INTO "player_storage" SELECT "id", 2425, 1 FROM "players" WHERE "online" = 0 ON DUPLICATE KEY UPDATE "value" = 0)


i'm using 0.36pl1
 
The syntax of the query in the script is for mysql and you are using sqlite. You must update it to use sqlite, better yet, switch to mysql as it it much better.
 
Back
Top