Guest User

Untitled

a guest
Feb 12th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. if (isset($db_config))
  15. {
  16. if (is_array($db_config))
  17. {
  18. $db = new Database();
  19. }
  20. }
  21.  
  22.  
  23. class Database {
  24.  
  25.  
  26. private $con = null;
  27. private $error = "";
  28. private $queries_to_log = null;
  29. private $query_log_file = null;
  30. public function __construct($server = "", $user = "", $pass = "", $dbname = "", $new_connection = false) {
  31.  
  32. if ($server == "" && $user == "" && $pass == "" && $dbname == "")
  33. {
  34. global $db_config;
  35. $server = $db_config["server"];
  36. $user = $db_config["user"];
  37. $pass = $db_config["pass"];
  38. $dbname = $db_config["db"];
  39. }
  40. $this->con = mysql_connect($server, $user, $pass, $new_connection);
  41. if (!$this->con)
  42. {
  43. $this->error = "Could not Connect to database Server";
  44. die($this->error);
  45. return false;
  46. }
  47. $rs = mysql_query("SELECT database()");
  48. $row = mysql_fetch_array($rs);
  49. $current_db = $row[0];
  50. if ($row[0] != "" && $row[0] != $dbname)
  51. {
  52. $this->con = mysql_connect($server, $user, $pass, true);
  53. }
  54. $select = mysql_select_db($dbname, $this->con);
  55. if (!$select)
  56. {
  57. $this->error = "Could not Connect to requested database";
  58. die($this->error);
  59. }
  60. $this->queries_to_log = false;
  61. $this->query_log_file = "";
  62. return;
  63. }
  64.  
  65. public function query($qry) {
  66.  
  67. $result = mysql_query($qry, $this->con);
  68. if ($result !== false)
  69. {
  70. ........................................................................
  71. ..............................
  72. ..........
Advertisement
Add Comment
Please, Sign In to add comment