이 문제는 며칠 동안 지속되었으므로 문제가있는 곳을 볼 수 없습니다. 나는 여러면에서 함수를 살펴 보았고, 심지어 PHP 사이트를 들여다 보았지만 이것을 풀 수는 없다.PHP가 MySQL에 삽입되지 않았습니다.
$sql = mysqli_query($db_connect, "INSERT INTO forum_post(post_author, post_author_id, date_time, type, section_title, section_id, thread_title, post_body) VALUES('$log_username', '$log_id', now(), 'a', '$forum_section_title', '$forum_section_id', '$post_title', '$post_body')");
if(mysqli_error($db_connect)) {
$message = mysqli_error($db_connect);
header("location: ../message.php?msg=$message");
}
$this_id = mysqli_insert_id($db_connect);
header("location: ../view_thread.php?id=$this_id");
exit();
:
그래서 내가 (내가 메시지를 볼 수 있습니다 오히려 그래서) 처리 오류를 처리하는 방법을 보여줄 수 ...
$sql = mysqli_query($db_connect, "INSERT INTO forum_post(post_author, post_author_id, date_time, type, section_title, section_id, thread_title, post_body) VALUES($log_username, $log_id, now(), 'a', '$forum_section_title', '$forum_section_id', '$post_title', '$post_body')");
$this_id = mysqli_insert_id($db_connect);
header("location: ../view_thread.php?id=$this_id");
편집 : 이것은 내가하는 데 문제가 있어요 코드입니다
당신이 지금까지 시도 무엇입니까? mysqli_error ($ db_connect);를 사용하고 리디렉션을 주석 처리하는 것이 가장 먼저해야 할 일입니다. – jeroen
항상 $ mysqli-> error'를 디버깅 용으로 사용하면 오류로 안내 할 수 있습니다. [링크] http://www.php.net/manual/en/mysqli.error.php [링크] – amigura
지금 mysqli_error를 사용하고 있습니다. 이것을 알아낼 수 있는지 확인하겠습니다. –