Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?php
  2. class CMySQL
  3. {
  4.     public static function Connect($host = "localhost", $user = "", $password = "")
  5.     {
  6.         return mysql_connect($host, $user, $password);
  7.     }
  8.    
  9.     public static function Select($link = NULL, $databaseName = "")
  10.     {
  11.         if($link == NULL or !is_resource($link)) { return false; }
  12.        
  13.         return mysql_select_db($databaseName, $link);
  14.     }
  15.    
  16.     public static function Query($link = NULL, $query = "")
  17.     {
  18.         if($link == NULL or !is_resource($link)) { return false; }
  19.        
  20.         return mysql_query($databaseName, $link);
  21.     }
  22.    
  23.     public static function Num($link = NULL)
  24.     {
  25.         if($link == NULL or !is_resource($link)) { return false; }
  26.        
  27.         return mysql_num_rows($link);
  28.     }
  29.    
  30.     public static function Fetch($link = NULL)
  31.     {
  32.         if($link == NULL or !is_resource($link)) { return false; }
  33.        
  34.         return mysql_fetch_assoc($link);
  35.     }
  36.    
  37.     public static function InsertID($link = NULL)
  38.     {
  39.         if($link == NULL or !is_resource($link)) { return mysql_insert_id(); }
  40.        
  41.         return mysql_insert_id($link);
  42.     }
  43.    
  44.     public static function Close($link = NULL)
  45.     {
  46.         if($link == NULL or !is_resource($link)) { return false; }
  47.        
  48.         return mysql_close($link);
  49.     }
  50. }
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement