SPRING :: NOTE

[PHP] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource 본문

Development Language

[PHP] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

RAYZIE 2016. 6. 2. 15:59
반응형

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource


위와 같은 에러가 떴을 때, 여러가지 증상이 있을테지만 나와 같은 경우에는 쿼리문에서 실수가 있었다.



$query = $query = "select * from user where USER_ID=".$_POST['ID'];


위와 같이 써줬는데


USER_ID를 검색 할 때 작은 따옴표를 안붙였다. 간단한 실수다.


수정된 코드는



$query = "select * from user where USER_ID='".$_POST['ID']."'";
반응형
Comments