我正在尝试更新数据库中的字段,但没有任何反应。我认为可能存在语法错误,但我找不到它!任何帮助将不胜感激。
CODE
$session = $_SESSION['session'];
$add_data = array(
'user_id' => $session_user_id,
'item_title' => $_POST['item_title'],
'product_type' => $_POST['product_type'],
'size' => $_POST['size'],
'condition' => $_POST['condition'],
'duration' => $_POST['duration'],
'dispatch' => $_POST['price'],
'paypal_email' => $_POST['paypal_email'],
'description' => $_POST['description'],
);
array_walk($add_data, 'array_sanitize');
$fields = '`' . implode('`, `', array_keys($add_data)) . '`';
$data = '\'' . implode('\', \'', $add_data) . '\'';
mysqli_query($con, "UPDATE `temp` SET ($fields) VALUES ($data) WHERE session = $session AND user_id = '$session_user_id'");