query("SELECT * FROM config_api WHERE groups = '" . $groups . "'");
if ($result->num_rows == 0) {
// 数据库中不存在该记录,执行插入操作
$data = $con->query("INSERT INTO config_api (groups, channel, uid, historyId, unicomMallUid, referer, pageKey) VALUES ('" . $groups . "', '" . $channel . "', '" . $uid . "', '" . $historyId . "', '" . $unicomMallUid . "' , '" . $referer . "', '" . $pageKey . "')");
if ($data) {
echo "";
} else {
echo ("");
}
} else {
// 数据库中存在该记录,执行更新操作
$data = $con->query("UPDATE config_api SET channel = '" . $channel . "', uid = '" . $uid . "', historyId = '" . $historyId . "', unicomMallUid = '" . $unicomMallUid . "', referer = '" . $referer . "', pageKey = '" . $pageKey . "' WHERE groups = '" . $groups . "'");
if ($data) {
echo "";
} else {
echo ("");
}
}
}
$con->close();
?>