Advertisement
Guest User

Untitled

a guest
May 14th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?PHP
  2.  
  3. class mysql{
  4. global $host, $user, $pass, $conn, $db;
  5. /* mySQL connection information */
  6. $host = "";
  7. $user = "";
  8. $pass = "";
  9. $db   = "";
  10. $conn = mysql_connect($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass']);
  11.  
  12. function openconnection(){
  13.  if($GLOBALS['conn'])){
  14.    return "SQL Connection Established";
  15.    selectdatabase();
  16.  }else{
  17.    return "SQL Connection Failed: ".mysql_error());
  18. }
  19.  
  20. function selectdatabase(){
  21.  if((mysql_select_db($GLOBALS['conn'], $GLOBALS['db']))){
  22.    return "Database ";
  23. }
  24.  
  25. function closeconnection(){
  26.  if(mysql_close($GLOBALS['conn'])){
  27.    return "Database Connection Sucessfully Closed";
  28.   }else{
  29.    return "Database Connection Failed To Close: ".mysql_error();
  30. }
  31.  
  32. function checktables(){
  33.  
  34. }
  35.  
  36. function query($database, $query){
  37.  
  38. }
  39.  
  40.  
  41. }
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement