INSERT INTO > PHP

본문 바로가기

사이트 내 전체검색

뒤로가기 PHP

MySQLi Extension INSERT INTO

페이지 정보

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

본문

$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;

}


댓글목록 0

등록된 댓글이 없습니다.

Copyright © neion.co.kr All rights reserved.
PC 버전으로 보기