alexville Posted April 2, 2009 Share Posted April 2, 2009 Probably a simple thing to fix, but I have forgotten how to fix this problem. Here is my code: $query = "INSERT INTO $table (user_id, chat_data, chat_message) VALUES ('$uniqid','$date','$output')"; When the text in the $output variable includes a quote ( ' or " ) the query fails. What can I do to fix this problem? Thanks Freaks! Link to comment https://forums.phpfreaks.com/topic/152309-quotes-are-killing-my-php-mysql-querys/ Share on other sites More sharing options...
redarrow Posted April 2, 2009 Share Posted April 2, 2009 $varable_name=mysql_real_escape_string($_POST['varable_name']); <<<<<< needs adding to all posting variables. Link to comment https://forums.phpfreaks.com/topic/152309-quotes-are-killing-my-php-mysql-querys/#findComment-799871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.