check the manual that corresponds to your MySQL server version for the right syntax to use near
프로그래밍/php2014. 7. 25. 16:52
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near xxxxxxxxxxxxxxxxxx
아 씡.. phpMyAdmin에서 쿼리를 쓰면 되는데 php에서 적어서 불러오면 안됨;;
INSERT INTO table_name() VALUES() table_name안에 들어갈 컬럼이름에 `` 해줬더니 됨;;
아무래도 지원 자료형중 하나랑 이름이 겹쳤나봄;; 아니면 컬럼네임을 바꿔줘도 된다.
해결방법 1. 컬럼 네임을 바꿔준다.
2. 컬럼 네임에 ``붙인다
[수정] 많이들 보시네요.. 좀 더 자세히 설명하자면. 키보드에서 Esc키 밑에 ` 있죠? 컬럼을 지칭할땐 저걸 써주고, 변수를 써줄땐 어께점 ' 을 써주는겁니다.
ex) $i = 100; $col="id_number" /
mysql_query("SELECT * FROM user WHERE `$col`='$id'"); -> SELECT * FROM user WHERE id_number=100;
'프로그래밍 > php' 카테고리의 다른 글
[MySQL] select 안에 select. (0) | 2019.12.08 |
---|---|
[APMSetup] 외부접근 허용시키기! (0) | 2015.06.18 |
[APM] 설치 (0) | 2015.06.18 |
parent.document.getElementById / 적용 안되는 경우 (0) | 2015.01.10 |
Warning: implode() [function.implode]: Invalid arguments passed in xxx on line xx (0) | 2014.07.25 |