기존 데이터베이스에 이미지 경로를 삽입하려고합니다. 아래 코드는 작동하지만 새 행을 삽입합니다.세션이있는 SQL 업데이트
$address= htmlentities($_SESSION['address']);
$city= htmlentities($_SESSION['city']);
$zip_code= htmlentities($_SESSION['zip_code']);
$query =
"INSERT INTO property(name, size, type_picture, file_path, username) VALUES (?,?,?,?,?)";
$conn = $db->prepare($query);
if ($conn == TRUE) {
$conn->bind_param("sisss", $myfile, $fileSize, $fileType, $path, $username);
if (!$conn->execute()) {
echo 'error insert';
}else {
echo 'Success!<br/>';
echo '<img src="' . DISPLAY_PATH . $myfile . '"/>';
}
} else {
die("Error preparing Statement");
위와 같지만 업데이트를 시도하면 "오류 준비 명령문"이 표시됩니다. 빈 셀을 업데이트해야합니다 (중요 할 경우).
고맙습니다. 하루를 보시고, 도움이 필요합니다.
업데이트 세션과는 전혀 무관하다. –
또한이 사이트는 도움이되지 않습니다. 그것은 질문에 대답하는 것입니다. –
도움에 관한 것입니다. 이드는 내 의견을 downvote 의견을 downvote 수 있습니다. –