2010-12-22 5 views
0

PHP를 통해 mysql db에 등록 정보를 입력하려고하는데 SQL 문이 잘못되었습니다. 누구든지 내가 뭘 잘못하고 있는지 말해 줄 수 있니?SQL 구문 오류가 발생하지 않습니다.

INSERT INTO user(id,username,password,email,security_question,security_answer,face_photo,body_photo,user_salutation,user_firstname,user_middlename,user_lastname,parent_salutation,parent_firstname,parent_middlename,parent_lastname,gender,date_of_birth,address1,address2,country,state,city,pincode,country_code1,area_code1,phone1,country_code2,area_code2,phone2,alt_email,website,travel_within,passport,travel_companion,formal_education,other_qualification,known_languages,hobbies,about_you) VALUES('',some username,abcabc,[email protected],What is your first pet\'s name?,I don\'t know,'','',Mr.,sam,,fisher,Mr.,,,,Male,05/12/2009,test address1,,10,1073,16713,000000,00,00,00000000,,,,[email protected],[email protected],Within Country,on,on,none,none,spanish,none,none) 
+0

다음에 어떤 라인이 코드에 나누기 추가하십시오. 하나의 큰 단일 줄에 모든 것을 넣으면 읽는 것이 매우 어렵습니다. –

답변

3

당신은 당신의 문자열 값의 따옴표가 없습니다 :

.....) VALUES('', 'some username', 'abcabc', '[email protected]'..... etc... 
+0

감사합니다. PHP에서 mysql로 ​​$ _Post vars를 저장하는 쿼리를 작성하기위한 모든 기본 규칙이있는 좋은 자습서가 있습니까? backticks와 singleqoutes를 사용할 때와 get_magic_quotes_gpc()와 같은 함수를 사용하여 코드를 안전하게 작성하는 방법 – Bluemagica

관련 문제