Mysql update query
#1

Hi,

Can i update query without ' ?

Код:
update table set smthing=%s where name=%s ?
Reply
#2

Why would you?
Reply
#3

Because i'am getting syntax errors of using ' because '%s' and if text is with ' 'hello'myname' i get syntax
Reply
#4

Then you need to figure out a way to strip or replace the use of ' within chat/text/strings

Basically you need to convert the ' being used to " or \' (i believe), BEFORE its fed into the mysql query
Reply
#5

Not using ' ' to make it a text will result in more problems as it will find those words invalid keywords.
You'll need to escape the strings so use mysql_format with '%e' specifier.
Reply
#6

Can i use mysql_real_escape_string instead?

And i notice if i use mysql_format with %e specifier inquiries carried out and i self test if ' is escaped to \' i tried in phpmyadmin make query where text was with \' and query was not updated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)