Skip to content

Instantly share code, notes, and snippets.

@lsferreira42
Created February 5, 2018 21:16
Show Gist options
  • Save lsferreira42/56fb2484dfaa2388c457168d2af24afd to your computer and use it in GitHub Desktop.
Save lsferreira42/56fb2484dfaa2388c457168d2af24afd to your computer and use it in GitHub Desktop.
<?php
//API KEY
$new_api_key = 'NOVACHAVEDEAPI';
//Pega as variaveis necessarias e testa a conexao
include_once "wp-config.php";
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$link) {
die('cant connect to the database!');
}
echo 'connected!';
$sql_update_key = 'UPDATE wp_options set option_value = "' . $new_api_key . '" where option_name = "gocache_option-api_key";';
$result = mysqli_query($link, $sql_update_key);
mysqli_close($link);
echo 'updated!'
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment