MYSQL query error : Commands out of sync; you can't run this command now


이 에러 같은 경우에 보통 쿼리를 두가지 이상 실행할 때, 나타난다.


그래서 새로운 쿼리 문이 실행되기 전에 


mysql_free_result();


를 선언해서 메모리에 기존의 것을 제거시켜준다.


1
2
3
4
5
6
7
...
res = mysql_perform_query(conn, "...");
...
 
mysql_free_result(conn); <<추가
 
mysql_perform_query(conn, "...");
cs