Jump to content

Quotes are killing my PHP Mysql Querys


alexville

Recommended Posts

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!  ;D

Link to comment
https://forums.phpfreaks.com/topic/152309-quotes-are-killing-my-php-mysql-querys/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.