public bool UpdateUser(DDO_User ddo)
        {
            cmd = "update user set `user_name`=\"" + ddo.m_username + "\",`password`=\"" + ddo.m_pwd + "\",`question`=\"" + ddo.m_pwdProtectProblem + "\",`answer`=\"" + ddo.m_pwdProtectAnswer + "\" where `userid`=" + ddo.m_playerId + ";";

            try { pool.ExecuteSql(database, cmd); } catch { return(false); }
            return(true);
        }
        public int InsertUser(DDO_User ddo)
        {
            try {
                DataSet ds = new DataSet();
                cmd = "insert into `user` values(null,\"" + ddo.m_username + "\",\"" + ddo.m_pwd + "\",\"" + ddo.m_pwdProtectProblem + "\",\"" + ddo.m_pwdProtectAnswer + "\");select last_insert_id();";

                //Console.WriteLine(cmd);
                pool.ExecuteSql(database, cmd, ds);
                return(int.Parse(ds.Tables[0].Rows[0]["last_insert_id()"].ToString()));
            } catch {
                return(-1);
            }
        }
        //USER
        public bool GetUserByUsername(string username, out DDO_User resUser)
        {
            DataSet ds = new DataSet();

            cmd = "select * from `user` where user_name=\"" + username + "\";";

            pool.ExecuteSql(database, cmd, ds);
            if (ds.Tables[0].Rows.Count == 0)
            {
                resUser = default(DDO_User);
                return(false);
            }
            resUser = new DDO_User(int.Parse(ds.Tables[0].Rows[0]["userid"].ToString()), username, ds.Tables[0].Rows[0]["password"].ToString(), ds.Tables[0].Rows[0]["question"].ToString(), ds.Tables[0].Rows[0]["answer"].ToString());
            return(true);
        }