Hey,
I am inserting data into my table like so with TinyMCE text editor...
This inserts fine, but when i want to read out the data it does not display. I did some phishing and worked out that it was the apotrophes causing this. When i take the apostrophes out of the data i can display the text. So this means i cant write "Queen's" i have to write "Queens".PHP Code:$title = mysql_real_escape_string($_POST['txt_title']);
$details = mysql_real_escape_string($_POST['txt_details']);
$date = mysql_real_escape_string($_POST['txt_date']);
$info = mysql_real_escape_string($_POST['txt_info']);
$day = mysql_real_escape_string($_POST['txt_day']);
$title = str_replace(array('<p>', '</p>', '<div>', '</div>'), '', $title);
$details = str_replace(array('<p>', '</p>', '<div>', '</div>'), '', $details);
$info = str_replace(array('<p>', '</p>', '<div>', '</div>'), '', $info);
$insert = "INSERT INTO bills (bill_title, bill_info, bill_date, other_info, bill_day, active, archive, date_added) VALUES
(
'$title',
'$details',
'$date',
'$info',
'$day',
'1', 'NO', now()
)";
$add_member = mysql_query($insert);
Why is this? There are obviously going to be times where users enter apostrophes when entering data..
Can i fix this?
Regards
Billy





Bookmarks