<% mc.Open(); string quo = "INSERT INTO online(nick, lastlogin) VALUES (?nick, ?lastlogin)"; MySqlCommand mcommuo = new MySqlCommand(quo, mc); mcommuo.Parameters.AddWithValue("?nick", Request.Cookies["ut"].Value); mcommuo.Parameters.AddWithValue("?lastlogin", Convert.ToString(DateTime.Now)); mcommuo.ExecuteNonQuery(); mc.Close(); //mc.Open(); string quo1 = "SELECT DISTINCT nick FROM online WHERE lastlogin>'"+Convert.ToString(DateTime.Now.AddMinutes(-2))+"'"; MySqlCommand mcommuo1 = new MySqlCommand(quo1, mc); //MySqlDataReader mdruo = mcommuo1.ExecuteReader(); //DateTime ora = DateTime.Now; DataSet dsuo = new DataSet(); MySqlDataAdapter mdauo = new MySqlDataAdapter(quo1, mc); mdauo.Fill(dsuo); int numuo = dsuo.Tables[0].Rows.Count; // while (mdruo.Read()) DataRowCollection drcuo = dsuo.Tables[0].Rows; %> <% for(int iuo=0; iuo %>
There are <%= numuo %> users online
"><%= druo["nick"] %>