SA-MP Forums Archive
MySQL little problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL little problem (/showthread.php?tid=308509)



MySQL little problem - GamingTurf - 03.01.2012

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.


Re: MySQL little problem - [HiC]TheKiller - 03.01.2012

Escape the string with mysql_real_escape_string or use mysql_format.