Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //C#
- string connStr = "server=localhost;user=zafer;database=isee;port=3306;password=ygzp5q;";
- void ProcessUpdate()
- {
- using(MySqlConnection conn = new MySqlConnection(connStr))
- {
- conn.Open();
- string query = "SELECT `t`.`TeamName`, `t`.`money`, `s`.`Score` FROM `Teams` `t` LEFT join `SiteScoring` `s` on `s`.`TeamID` =`t`.`TeamID` WHERE `t`.`classID`='1' ORDER BY `t`.`TeamName` ASC";
- using(MySqlCommand cmd = new MySqlCommand(query, conn))
- {
- using(MySqlDataReader reader = cmd.ExecuteReader())
- {
- int counter = 1;
- while(reader.Read())
- {
- int score = 0;
- int money = 0;
- if(!reader.IsDBNull(1))
- money = reader.GetInt32(1);
- if(!reader.IsDBNull(2))
- score = reader.GetInt32(2);
- llMessageLinked(LINK_SET, counter, money.ToString(), score.ToString());
- counter ++;
- }
- }
- }
- }
- }
- public void default_event_state_entry()
- {
- llSetTimerEvent(30.0);
- }
- public void default_event_timer()
- {
- ProcessUpdate();
- }
- public void default_event_touch_start(LSL_Types.LSLInteger z)
- {
- ProcessUpdate();
- }
Add Comment
Please, Sign In to add comment