0

im using xampp

i used the $_POST[] to get the text from a text box in a form file to store it in a table.

if the text entered in the form contains any of these characters (,.?' " \ ; :> <!...) it returns an error message like this,

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's missile_carrier?' at line 3

The entered text was "China hails: first; test of-hypersonic nuclear's missile_carrier?"

how to make it accept the text with these characters ((,.?' " \ ; :> <!...)...

pls help

Gurfuffle
  • 784
  • 12
  • 32

1 Answers1

0

As advised please use mysqli and then use mysqli_real_escape_string http://uk3.php.net/manual/en/mysqli.real-escape-string.php

Shaun Hare
  • 3,771
  • 2
  • 24
  • 36