fixed order of prevInput, sqlHelper() now takes 4 strings these are
dbName, tableName, selection and order.