Hi,
This must be an old chestnut, but I couldn’t find
a straightforward answer when I searched.
My php script updates my mySQL table update like this:
[PHP]
$sql_insert = "INSERT INTO `emailqueue` (member_no,client_no, em_type, broad_no, camp_no, gift_no, link_no, sub_no, author, to_mail, contact, subject,mess, country, attempts, sent, send_date )
VALUES
( '$member_no','$client_no','$em_type','$broad_no','$camp_no','$gift_no','$link_no','$sub_id','$author','$to','$contact',
'$subject2','$message2','$country','$mess_no','n','$today_time')";
[/PHP]
So when my $subject2 variable or my $message2 contain an apostrophe, the code breaks and I get an error.
EG $subject2 = "Oh no You didn't get it";
This $subject2 variable is not input at this time but is being pulled out of a different table and gets inserted if the date is correct.
There must be a fairly standard method of dealing with this
Many thanks,