• 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!

rare error console

crashwan

New Member
Joined
Oct 6, 2012
Messages
53
Reaction score
0
Rare error, which is a problem?

Code:
[15/10/2012 2:19:6] Fgdfgd has logged out.
[15/10/2012 2:19:6] Captain Morgan's has logged in.
[15/10/2012 2:19:6] mysql_real_query(): UPDATE `players` SET `ip` = '200.83.188.247' WHERE name = 'Captain Morgan's'; - MYSQL ERROR: 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 's'' at line 1 (1064)
[15/10/2012 2:19:8] Gdfgd has logged in.
[15/10/2012 2:23:37] > Broadcasted messag



Uploaded with ImageShack.us
 
Either the ' symbol should not be allowed in names or you need to escape string the name in the sources..

Which version are you using? (Server version and name)
 
edit: Ye, as Summ says.

Stupid me re-inventing the weel. :|
 
Last edited:
Are you using a script to update the ip?
I could not find a line in sources which says WHERE name = , only WHERE `name` = so I guess it is a script.

Just use: db.escapeString(user_input)
So ->
LUA:
bla .. " WHERE name = " .. db.escapeString(playerName) .. ";"
 

Similar threads

Back
Top