Advertisement
Guest User

Untitled

a guest
Aug 17th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. //------- Open Connection Function --------------//
  2.  
  3. function DB()
  4. {
  5. $this->host = "localhost";
  6.  
  7. $this->db = "toplinee_toplline";
  8.  
  9. $this->user = "toplinee_topl";
  10.  
  11. $this->pass = "toplline";
  12. $Charset = 'utf8';
  13. $this->link = mysql_connect($this->host, $this->user, $this->pass);
  14. mysql_query("SET NAMES $Charset;", $this->link) or die ('Unable to connect to the server: '.mysql_error());
  15. mysql_select_db($this->db);
  16. }
  17.  
  18. //------- Open Connection Function ---------------//
  19. //''''''''''''''''''''''''''''''''''''''''''''''''//
  20. //------- Close Connection Function --------------//
  21.  
  22. function close()
  23. {
  24. mysql_close($this->link);
  25.  
  26. }
  27.  
  28. //------- Close Connection Function ---------------//
  29. //'''''''''''''''''''''''''''''''''''''''''''''''''//
  30. //------- Get Result Function ---------------------//
  31.  
  32. function query($query)
  33. {
  34. $result = mysql_query($query, $this->link);
  35. return $result;
  36. }
  37.  
  38. }
  39.  
  40.  
  41. ?>
  42.  
  43. $this->link = mysqli_connect($this->host, $this->user, $this->pass , $this->db);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement