js/main.js
// check if the query alters the database, return true if so!

check if the query alters the database, return true if so!
check if the query alters the database return true if so!
function checkDBChanges(x) {
    if (
        x.toUpperCase().indexOf("INSERT INTO ") > -1 ||
        x.toUpperCase().indexOf("UPDATE ") > -1 ||
        x.toUpperCase().indexOf("DELETE ") > -1 ||
        x.toUpperCase().indexOf("ALTER TABLE ") > -1 ||
        x.toUpperCase().indexOf("DROP TABLE ") > -1 ||
        x.toUpperCase().indexOf("INTO ") > -1 ||
        x.toUpperCase().indexOf("CREATE TABLE ") > -1 ||
        x.toUpperCase().indexOf("ALTER TABLE ") > -1 ||
        x.toUpperCase().indexOf("CREATE VIEW ") > -1 ||
        x.toUpperCase().indexOf("REPLACE VIEW ") > -1 ||
        x.toUpperCase().indexOf("DROP VIEW ") > -1 ||
        (x.toUpperCase().indexOf("CREATE INDEX") > -1) ||
        (x.toUpperCase().indexOf("CREATE UNIQUE INDEX") > -1) ||
        (x.toUpperCase().indexOf("DROP INDEX") > -1)
    ) {
        return true;
    }
    return false;
}
function checkDBChanges ( x ) { if ( x . toUpperCase ( ) . indexOf ( "INSERT INTO " ) > - 1 || x . toUpperCase ( ) . indexOf ( "UPDATE " ) > - 1 || x . toUpperCase ( ) . indexOf ( "DELETE " ) > - 1 || x . toUpperCase ( ) . indexOf ( "ALTER TABLE " ) > - 1 || x . toUpperCase ( ) . indexOf ( "DROP TABLE " ) > - 1 || x . toUpperCase ( ) . indexOf ( "INTO " ) > - 1 || x . toUpperCase ( ) . indexOf ( "CREATE TABLE " ) > - 1 || x . toUpperCase ( ) . indexOf ( "ALTER TABLE " ) > - 1 || x . toUpperCase ( ) . indexOf ( "CREATE VIEW " ) > - 1 || x . toUpperCase ( ) . indexOf ( "REPLACE VIEW " ) > - 1 || x . toUpperCase ( ) . indexOf ( "DROP VIEW " ) > - 1 || ( x . toUpperCase ( ) . indexOf ( "CREATE INDEX" ) > - 1 ) || ( x . toUpperCase ( ) . indexOf ( "CREATE UNIQUE INDEX" ) > - 1 ) || ( x . toUpperCase ( ) . indexOf ( "DROP INDEX" ) > - 1 ) ) { return true ; } return false ; }
check if the query alters the database, return true if so!
check if the query alters the database return true if so!