Problem: If the text that is inputted into this text field contains a single quote ( ' ) like: I'm or you're or we're, this record will not get written to the table.
However, all of the other characters, including double quotes, like "Hello", said Jack, work fine and the record gets written.
What am I doing wrong? Here's what I know:
MYSQL
table name: bidnotes_table
field : notes
type : text
null : not null
HTML:
<textarea cols="30" rows="7" name="notes"></textarea>
PHP:
if ($notes != ""){
// create a mySQL query to insert a new bid-notes record
$sql01 =
"INSERT INTO
bidnotes_table (
bnotesID,
crewID,
candID,
bidID,
date,
notes
)
VALUES
(
NULL,
'$crewID',
'$candID',
'$bidID',
'$notedate',
'$notes')";
// do the query
$result01 = mysql_query($sql01);
if i don't insert a single quote into the textarea, the record gets written as it should