我正在通过 php mysqli 运行以下查询$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 值。没有其他脚本影响此表或数据库。我无法确定何时放置 0 而不是 1 的任何模式。
referenceid
和keyid
字段都是' VARCHAR(100)
s。