MySQL little problem
#1

This is very part of my mysql query - It works, i've tried it over 300 times, but i have ran into a small problem.

If the string of '%s' contains a ', then the query doesn't work as it messes it up.

Such as:

If the string is:

The Camels Toe ->> It will work fine.
The Camel's Toe ->> It will not work.

pawn Код:
VALUES ('None', '%s',
I've tried "%s", and "'%s'" -> Both return errors.

This is probably simple - but i haven't been using MySQL for long.
Reply
#2

Escape the string with mysql_real_escape_string or use mysql_format.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)