Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mritzmann
Created November 4, 2017 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mritzmann/522fc0b2dd2dbe25d06ffeb4b397b50a to your computer and use it in GitHub Desktop.
Save mritzmann/522fc0b2dd2dbe25d06ffeb4b397b50a to your computer and use it in GitHub Desktop.
remove netcup db entries
# more information:
# https://github.com/dnszensur/dnszensur-web/issues/47
<?php
include '.env';
$db = mysqli_connect("$db_host", "$db_user", "$db_password", "$db_name");
$result = mysqli_query($db, "SELECT domain, autonomous_system FROM domains WHERE autonomous_system LIKE 'AS197540 netcup GmbH'");
while($row = mysqli_fetch_object($result))
{
echo $row->domain;
echo "\n";
echo $row->autonomous_system;
$new_entry = mysqli_query($db, "UPDATE domains Set country = ' ', autonomous_system = ' ' WHERE domain = '$row->domain'");
}
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment