For first time I have a mysql problem. I have an input field such as
<input type="text" name="myfield" id="myfield" />
So when the user presses the submit button I am getting the value with php
$myval = $_POST['myfield'];
Everything is ok so far.
If my value in this input field contains an apostrophe '
and for example:
<input type="text" name="myfield" id="myfield" value="Niko's Dog" />
the mysql query:
mysql_query ("INSERT INTO users (myfield) VALUES ('$myval')");
Fails to insert the data..
Any opinions please? I need all characters to be valid.