私は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