개발자의 끄적끄적

[php7/mysql] mysqli_insert_id() expects exactly 1 parameter, 0 given 에러 해결방법 본문

개발/php

[php7/mysql] mysqli_insert_id() expects exactly 1 parameter, 0 given 에러 해결방법

효벨 2020. 12. 21. 03:00
728x90
반응형

[php7/mysql] mysqli_insert_id() expects exactly 1 parameter, 0 given 에러 해결방법

 

 

php7 에서

 

mysql 을 사용할때

 

mysqli_insert_id() 실행시

 

아래와 같은 오류가 나타날때가 있습니다.

 

mysqli_insert_id() expects exactly 1 parameter, 0 given

 

위와 같은 오류가 나타나는 경우 대부분은

 

mysqli_insert_id() 만 선언해서

 

insert_id 를 가져오려는 경우일껍니다.

 

mysqli_insert_id() --> mysqli_insert_id($con)

 

위처럼

 

db연결정보를 담아서 같이 호출하면

 

에러가 없으실껍니다!

 

참고들 하세요!!

반응형
Comments