SA-MP Forums Archive
Replacing apostrophes in MYSQL with a simple " - 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: Replacing apostrophes in MYSQL with a simple " (/showthread.php?tid=470444)



Replacing apostrophes in MYSQL with a simple " - BullseyeHawk - 18.10.2013

Well, I have this problem with mysql with a dynamic faction system that each time I insert a apostrophes( ' ) it causes a generic bug.

I've been trying to replace it with a ( " ) but it's a problem due to samp using "..." as strings.
Is there anyway to somehow fix the bug or forcely insert the quote mark?


Re: Replacing apostrophes in MYSQL with a simple " - Misiur - 18.10.2013

You've got yourself the pretaste of sql injection. You have to escape your strings, using mysql_real_escape_string or some similar function, otherwise anyone can screw with your database