INSERT INTO > PHP

본문 바로가기
사이트 내 전체검색

PHP

MySQLi Extension INSERT INTO

페이지 정보

profile_image
작성자 관리자
댓글 0건 조회 5,818회 작성일 22-04-26 17:37

본문

$sql = "INSERT INTO MyGuests (firstname, lastname, email)

VALUES ('John', 'Doe', 'john@example.com')";



if ($mysqli->query($sql) === TRUE) {

  //if (mysqli_query($mysqli, $sql)) {


  //Get ID of The Last Inserted Record

  $last_id = $mysqli->insert_id;

  //$last_id = mysqli_insert_id($mysqli);


  echo $last_id;

} else {

  echo $mysqli->error;

}


댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

Copyright © neion.co.kr All rights reserved.