강의

멘토링

커뮤니티

Inflearn Community Q&A

yesolee8315's profile image
yesolee8315

asked

Create a web application by following along

데이터베이스에 데이터 추가가 안돼요 ㅠㅠ

Written on

·

236

0

웹애플리케이션만들기 - 정리8 34분의 SQL문 이랑 똑같이 적었는데 DB조회하면 user에 추가가 안됩니다ㅠㅠ

else {   

  $sql = "INSERT INTO user (id, name) VALUES (NULL, '{$author}');";

    $result=mysqli_query($conn, $sql);

    $user_id=mysqli_insert_id($conn);

DB에서 user테이블 구조도 확인하고 id에 auto_Increment도 확인했습니다.

또 아래단락에서 

$sql="INSERT INTO `topic` (`id`, `title`, `description`, `author`, `created`)

      VALUES (NULL,'{$title}','{$description}','{$user_id}',now());";

mysqli_query($conn, $sql);

이건 추가가 잘 되는데  user가 저장이 안되니까  author도 0으로 떠요 ㅠㅠ

도와주세요..

phpHTML/CSS

Answer

This question is waiting for answers
Be the first to answer!
yesolee8315's profile image
yesolee8315

asked

Ask a question