私はphpmysqliを介して次のクエリを実行しています$con->query($sql);
PHPコード:
$sql = 'UPDATE registrations SET '.$update_columns_list.' WHERE registrationkey = "'.$registration['RegistrationKey'].'"';
echo "RESULT: ".$result = $con->query($sql);
上記の例の値$sql
:
UPDATE registrations SET referenceid = "4469731" and action = "newregistration" and status = "newregistration" and registrationdatetimegmt = "1363371386" and billingmonth = "2013-03" and accessexpirationdatetimegmt = "1373957999" and returnurl = "https://api.mywebsite.com/login.aspx?siteid=209" and lastmodifieddatetimegmt = "1363371398" and studentkey = "12345-67890-12345-67890" and firstname = "amanda" and lastname = "hemingway" and email = "amandamhemingway@trashymail.com" and phonenumber = "111-111-1111" and city = "city" and state = "ca" and postalcode = "90210" and country = "us" and coursecode = "ABC-406" and coursetitle = "example course title" and courseproductcode = "t3310" WHERE registrationkey = "12345-67890-12345-67890"
このクエリを実行すると、すべてが正常に見えます(「成功」メッセージが表示され、影響を受ける行数は期待どおりです)。ただし、phpMyAdminを介してデータベース内の影響を受ける行を見ると、「referenceid」列に1または0の値が継続的に見つかります。このテーブルまたはデータベースに影響を与える他のスクリプトはありません。1ではなく0を配置するパターンを特定できませんでした。
referenceid
とkeyid
フィールドはどちらもVARCHAR(100)
'sです。