Skip to content

Instantly share code, notes, and snippets.

@ticklemynausea
Created February 27, 2014 09:54
Show Gist options
  • Select an option

  • Save ticklemynausea/9247275 to your computer and use it in GitHub Desktop.

Select an option

Save ticklemynausea/9247275 to your computer and use it in GitHub Desktop.
<?
#
# Minecraftia! Inquisitor json mapped 'org.bukkit.entity' remover
# v1.0
#
require 'bootstrap.php';
use minecraftia\db\Bitch;
$q = "SELECT name, mapped FROM inquisitor.players p WHERE p.mapped LIKE '%bukkit%' LIMIT 1;";
$result = Bitch::source('inquisitor')->all($q);
foreach ($result as $r) {
$j = json_decode($r["mapped"], true);
unset($j["mobsKilled"]["org"]);
$mapped = json_encode($j);
$q = "UPDATE inquisitor.players p SET p.mapped = :mapped WHERE p.name = :name";
$result = Bitch::source('inquisitor')->query($q, compact('mapped', 'name'));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment