Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.56 KB | None | 0 0
  1. class Network
  2. {
  3.     private $ranks;
  4.     private $username = "admin";
  5.     private $password = "Leaving blank for you, G.";
  6.     private $connection;
  7.    
  8.     public function __construct()
  9.     {
  10.         $this->ranks = array(0 => "Novice",
  11.                            1 => "Acolyte",
  12.                            2 => "Dedicate",
  13.                            3 => "Refina",
  14.                            4 => "Chaplain",
  15.                            5 => "Aperis",
  16.                            6 => "Sangen",
  17.                            7 => "Zealot",
  18.                            8 => "Ophae",
  19.                            9 => "Aderius",
  20.                            10 => "Accone",
  21.                            11 => "Antioch",
  22.                            12 => "Stolnik",
  23.                            13 => "Basileus");
  24.        
  25.         $this->connection = mysql_connect("network.luckyaceproductions.com", $this->username, $this->password) or
  26.                       die("A MySQL error occurred: " . mysql_error());
  27.         mysql_select_db("db_network", $this->connection);
  28.     }
  29.    
  30.     public function __destruct()
  31.     {
  32.         mysql_close($this->connection);
  33.     }
  34.    
  35.     public function createUser($Name, $MDivison, $Key, $Rank = 0)
  36.     {
  37.         mysql_query("INSERT INTO Enlisted(MName, Rank, MDivision, MKey) VALUES ('".$Name."', '".$Rank."', '".$MDivision."', '".$Key."')");
  38.         //echo "INSERT INTO Enlisted(MName, Rank, Division, MKey) VALUES ('".$Name."', '".$Rank."', '".$MDivision."', '".$Key."')";
  39.     }
  40.    
  41.     private function mySQL_query($text)
  42.     {
  43.         $data = mysql_query($text, $this->connection) or
  44.                 die("A MySQL error occurred when trying to retrieve data: " . mysql_error());
  45.         $return = array();
  46.         $temp;
  47.        
  48.         while(mysql_fetch_array($temp)) {
  49.             $return[] = $temp;
  50.         }
  51.        
  52.         return $return;
  53.     }
  54. }
  55.  
  56. $f = new Network();
  57. $f->createUser("Blossoming Rufus", "FFOOOOOOOO", "000");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement