function updateDB() {
// clear range I6:I30 asnd K6:K30 //DONE
SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(5, 10, 25, 1).clearContent();
SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(5, 12, 25, 1).clearContent();
// Get s some values
var username = SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(2, 5).getValue();
var database = SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(1, 5).getValue();
var password = SpreadsheetApp.getUi().prompt("Password").getResponseText();
var url = SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(3, 5).getValue();
var dbUrl = "jdbc:mysql://" + url + ":3306/" + database;
// Load the JDBC driver
var conn = Jdbc.getConnection(dbUrl, username, password);
// Loop to put multiple values
for (var loop1 = 5; loop1 <= 29; loop1++) {
// Update
var stmt = conn.createStatement();
var updateSql = SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(loop1, 9).getValue();
var updateResult = stmt.executeUpdate(updateSql);
// Put the result in the result cell
SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(loop1, 10).setValue(stmt.getUpdateCount());
// Close the statement
stmt.close();
}
for (var loop2 = 5; loop2 <= 29; loop2++) {
// Update
var stmt = conn.createStatement();
var updateSql = SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(loop2, 11).getValue();
var updateResult = stmt.executeUpdate(updateSql);
// Put the result in the result cell
SpreadsheetApp.getActive().getSheetByName("Twig and HTML").getRange(loop2, 12).setValue(stmt.getUpdateCount());
// Close the statement
stmt.close();
}
// Close the connection
conn.close();
}