php

2022.04.26 17:39

Insert Multiple

$sql = "INSERT INTO MyGuests (firstname, lastname, email) VALUES ('John', 'Doe', 'john@example.com');";

$sql .= "INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Mary', 'Moe', 'mary@example.com');";

$sql .= "INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Julie', 'Dooley', 'julie@example.com')";



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

  echo "New records created successfully";

} else {

  echo $mysqli->error;

}


  • 공유링크 복사
  • 이전글Prepared2022.04.26
  • 다음글INSERT INTO2022.04.26
  • 댓글목록

    등록된 댓글이 없습니다.