public static void Create(string uuid, string ip) { // IPエラー var ipCount = Convert.ToInt32(MySqlite.GetOne( "select count(1) from users " + "where ip = ? ", new object[] { ip } )); if (ipCount >= 1) { throw new Exception(); } MySqlite.Execute( "insert into users " + "(uuid, ip, created_at) values " + "(?, ?, ?) ", new object[] { uuid, ip, Utility.GetDatetime() } ); // 匿名ネームに変える int id = MySqlite.LastInsertedId(); MySqlite.Execute( "update users " + "set name = ? " + "where id = ? ", new object[] { "匿名" + id.ToString(), id } ); }
public static bool IsExist(string title, string artist) { return(Convert.ToInt32(MySqlite.GetOne( "select count(1) from subjects " + "where title = ? and artist = ? ", new object[] { title, artist } )) >= 1); }
private static string Get(string key) { return(MySqlite.GetOne( "select value from infos " + "where key = ? ", new object[] { key } )); }