BCR.UserDatabase.GetUserId C# (CSharp) Method

GetUserId() public static method

public static GetUserId ( string username ) : int
username string
return int
        public static int GetUserId(string username)
        {
            object result = Database.Instance.ExecuteScalar("SELECT id FROM user WHERE username = '" + username + "' LIMIT 1;");
              if (result == null)
            return -1;
              else
            return Convert.ToInt32(result);
        }