我正在尝试在 PHP 中使用 pq_query 更新数据库表。我有以下代码:
$q = "UPDATE tableName SET ('data1 = " . $data1 . "', data2='" . $data2 . "') WHERE user=".$user;
$success = pg_query($q);
if (!$success) {
$errormessage = pg_last_error();
echo "Error " . $errormessage;
}
我收到以下错误消息:
错误:“'data1 = '”处或附近的语法错误
LINE 1: UPDATE tableName SET ('data1 = 10', data2= 20'') WHERE user=