Skip to content

Instantly share code, notes, and snippets.

@rjmackay
Created August 8, 2012 05:36
Show Gist options
  • Save rjmackay/3292467 to your computer and use it in GitHub Desktop.
Save rjmackay/3292467 to your computer and use it in GitHub Desktop.
upgrade65-66.sql
ALTER TABLE `settings` ADD `allow_alerts` tinyint(4) NOT NULL DEFAULT '0';
UPDATE `settings` SET `db_version` = '66' WHERE `id`=1 LIMIT 1;
@ekala
Copy link

ekala commented Aug 8, 2012

Tried out this piece of code and it worked out just fine...

<?php 
if (($link = mysqli_connect("server", "user", "password", "database")) !== FALSE)
{
    $result = @mysqli_query($link, "ALTER TABLE `settings` ADD COLUMN `allow_alerts` tinyint(4) NOT NULL DEFAULT '0'");
    if ( ! $result)
    {
    print mysqli_error($link) . "\n";
    }
    else
    {
        print "Query exectuted successfully!\n";
    mysqli_close($link);
    }
}
?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment