public void Update(MySqlConnection conn, out Int32 cnt) { RunSQLCommand cmdrun = new RunSQLCommand(); string cmdout; cmdrun.comrun("SELECT COUNT(*) FROM chat", conn, out cmdout); cnt = Convert.ToInt32(cmdout); }
public void update(MySqlConnection conn, Int32 chatt, Int32 chatpoint, out Int32 chatpointer, string user) { RunSQLCommand cmdrun = new RunSQLCommand(); string msg; string usr; string time; string usrto; do { if (chatpoint > chatt) { break; } else { cmdrun.comrun("SELECT userto FROM chat WHERE id='" + chatpoint + "';", conn, out usrto); if (usrto == "" || usrto == user || user == "admin") { cmdrun.comrun("SELECT Message FROM chat WHERE id='" + chatpoint + "';", conn, out msg); cmdrun.comrun("SELECT user FROM chat WHERE id='" + chatpoint + "';", conn, out usr); cmdrun.comrun("SELECT timestamp FROM chat WHERE id='" + chatpoint + "';", conn, out time); if (usrto == user || user == "admin") { Console.WriteLine(time + ":: PM from " + usr + " TO " + user + ">" + msg); } else { Console.WriteLine(time + "::" + usr + ">" + msg); } } chatpoint++; } } while (true); chatpointer = chatpoint; }
public void send(string text, string user) { string test; Program program = new Program(); SQLConnect connect = new SQLConnect(); RunSQLCommand cmdrun = new RunSQLCommand(); MySqlConnection conn = connect.connect(); bool pm; string userto; Regexfind(text, out userto, out pm); if (pm == true) { RegexReplace(text, "\\" + userto + " ", "", out text); RegexReplace(userto, "\\/", "", out userto); } cmdrun.comrun("INSERT INTO chat (message, user, userto) VALUES('" + text + "', '" + user + "', '" + userto + "'); ", conn, out test); }