6
Tôi cần lưu vào danh mục cơ sở dữ liệu như "& b" nhưng mô hình lưu trong cơ sở dữ liệu chỉ "a" bỏ trống không gian và &.PHP Lưu mảng trong cơ sở dữ liệu và bỏ lỡ dữ liệu
Đây là mảng:
$data = array('avenvu' => $_POST['avenvu'],
'brand' => $_POST['brand'],
'category' => $_POST['category'],
'description' => $_POST['description'],
'man_women_shop'=> $_POST['man_women_shop'],
'postdatetime' => date("Y-m-d H:i:s",time()),
'publish' => 1,
'user_id' => $this->session->userdata('user_id'));
$result = $this->personal_closest->insertCloset($data);
Và đây là mô hình:
function insertCloset($data) {
$this->db->insert('personal_closest',$data);
}
loại bỏ htmlspecialchars và thử. và cố gắng thay đổi collasion cột thành utf-8-bin. tại thời điểm phân loại htmlspecialchars sẽ là cần thiết. –
lỗi tương tự mà tôi đã thử. – mds
ok viết mysqli_real_escape_string ($ _ POST ['category']); –