Syntax errors.
#1

Hi,

Sometimes i get syntax error mysql.log, i save player messages /pm what write to other player and i always escaping it, how possible to get syntax error what message player should write that i could get syntax error?

I do like that:

Код:
update table set msg1='%s',msg2='%s' and so on... WHERE name='%s'", ... );
Everything is ok query is completing but how i mention sometimes i get syntax error when message is incorrent how i gues.
Reply
#2

Are you sure the variable that supposed to hold the query is big enough? If it's not big enough, the query will give the syntax error.
Reply
#3

using ' symbol can destroy the query example if I send
You're noob,the query won't get excuted, do a loop / function to auto remove ' and ` from player message in the query .-.
Reply
#4

But i'am using escaping

https://sampwiki.blast.hk/wiki/Escape_codes

It have to escape ' to \' or no?
Reply
#5

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
But i'am using escaping

https://sampwiki.blast.hk/wiki/Escape_codes

It have to escape ' to \' or no?
No Escape doing the ' twice lol example if you do:
You're bish!
it will make it: You''re bish
Reply
#6

And how i could safely remove that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)