Sam's SQL login code