I am building some new script for add long text with whitespace to MySQL
. I need to send array elements using encode from JSON
to MySQL
table. encode also working fine. My question is when I tried to insert data MYSQL
is reject data.
$day_details['description']=escape_string($_POST['description']);
$data_[]=$day_details;
$mysql_desc=json_encode($data_);
$sql="INSERT INTO 'table' 'description' VALUES ('".$mysql_desc."')";
if($conn->query($sql)){
}
syntax error