나는 upc 데이터베이스에서 데이터를 검색 한 다음 데이터를 내 데이터베이스에 삽입하려고합니다. 모든 코드는 정확하지만 데이터베이스를 검사 할 때 내 데이터베이스 테이블에 레코드가 없습니다. 내 코드는 데이터 삽입 문제
if(!$resp->faultCode()) { //Store the value of the response in a variable $val = $resp->value(); //Decode the value, into an array. $data = XML_RPC_decode($val); //Optionally print the array to the screen to inspect the values echo $upc=$data['upc']; echo $ean=$data['ean']; echo $description=$data['description']; echo $size=$data['size']; $query1="INSERT INTO upc(upc,ean,description,size) values('$upc','$ean','$description','$size')"; var_dump($query1); $result1=mysql_query($query1);입니다. 참고 사항 나는 모든 변수를 반향하고 결과는 다음과 같이 표시됩니다.
639382000393 0639382000393 The Teenager's Guide to the Real World by BYG Publishing book string(166) "INSERT INTO upc(upc,ean,description,size) values('639382000393 ','0639382000393 ','The Teenager's Guide to the Real World by BYG Publishing ','book ')" 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 's Guide to the Real World by BYG Publishing ','book ')' at line 1데이터가 테이블에 삽입되지 않습니다.
mysql_query는 무엇을 반환합니까? 'true' 또는'false'? mysql_query가'false '를 반환하면 항상 mysql_error로 에러 메시지를받을 수있다. – PatrikAkerstrand
내 질문을 에러 – hunter
으로 업데이트한다. 쿼리 결과를 확인한다. – Grumpy