0) {
// 数据库中已存在记录,执行更新操作
$update_query = "UPDATE config_api SET userid='$userid', token='$token'";
if ($type == "haokeyun") {
$update_query .= ", gdkey='$gdkey'";
}
$update_query .= " WHERE groups='$groups'";
$update_result = mysqli_query($con, $update_query);
if ($update_result) {
echo "";
} else {
echo "";
}
} else {
// 数据库中不存在记录,执行插入操作
$insert_query = "INSERT INTO config_api (groups, userid, token";
$insert_values = "VALUES ('$groups', '$userid', '$token'";
if ($type == "haokeyun") {
$insert_query .= ", gdkey";
$insert_values .= ", '$gdkey'";
}
$insert_query .= ") " . $insert_values . ")";
$insert_result = mysqli_query($con, $insert_query);
if ($insert_result) {
echo "";
} else {
echo "";
}
}
} else {
echo "";
}
$con->close();
?>