mysql 서버의 테이블을 업데이트하려고 할 때 문제가 발생했습니다.PHP SQL 업데이트 오류
코드 다음는 mysql_query에서
$name = trim(FilterText($_POST['name']));
$description = trim(FilterText($_POST['description']));
$type = $_POST['type'];
if($groupdata['type'] == "3" && $_POST['type'] != "3"){ echo "You may not change the group type if it is set to 3."; exit; } // you can't change the group type once you set it to 4, fool
if($type < 0 || $type > 3){ echo "Invalid group type."; exit; } // this naughty user doesn't even deserve an settings update
if(strlen(HoloText($name)) > 25){
echo "Name too long\n\n<p>\n<a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"><b>Done</b><i></i></a>\n</p>\n\n<div class=\"clear\"></div>";
} elseif(strlen(HoloText($description)) > 200){
echo "Description too long\n\n<p>\n<a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"><b>Done</b><i></i></a>\n</p>\n\n<div class=\"clear\"></div>";
} elseif(strlen(HoloText($name)) < 1){
echo "Please give a name\n\n<p>\n<a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"><b>Done</b><i></i></a>\n</p>\n\n<div class=\"clear\"></div>";
} else {
mysql_query("UPDATE groups SET name = '".$name."', type = $type, desc='".$description."' WHERE id = $groupid AND ownerid = '".USER_ID."' LIMIT 1") or die(mysql_error());
echo "Editing group settings successful\n\n<p>\n<a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"><b>Done</b><i></i></a>\n</p>\n\n<div class=\"clear\"></div>";
}
업데이트하는 그룹, 내가 DESC = blahblahbla를 삽입 할 때 나는이 부분에서 내 SQL 구문에 오류가 있습니다 않다는 오류가 계속 나타납니다.
"desc"부분을 쿼리에서 제거하고 이름과 형식 만 삽입하면 쿼리가 완벽하게 작동하지만 desc를 쿼리에 다시 추가하면 오류가 다시 throw됩니다. 디테일 부분에는 ''이 없기 때문에 코드의 시작 부분에 필터를 걸었습니다.
도움을 주시면 감사하겠습니다. 경우에 당신은 사전에
감사를 궁금해
나는 CMS를 사용하고 있습니다! :)
감사를 시도 ... 3 ... 4 ... 5 내파! 나는 "desc by order"를 클릭하지 않았다. 대단히 감사합니다! – zuc0001
바쁜 이들이 공공 서비스를 수행하고 있습니다. – pilcrow