Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php
  2. if (!function_exists('mysql_query')) {
  3.  
  4.     function mysql_query($query, $mylink = null)
  5.     {
  6.         if (is_null($mylink)) {
  7.             global $link;
  8.  
  9.         } else {
  10.             $link = $mylink;
  11.         }
  12.         return mysqli_query($link, $query);
  13.     }
  14.  
  15. }
  16.  
  17. if (!function_exists('mysql_fetch_assoc')) {
  18.  
  19.     function mysql_fetch_assoc($result)
  20.     {
  21.         if (is_null($mylink)) {
  22.             global $link;
  23.  
  24.         } else {
  25.             $link = $mylink;
  26.         }
  27.         return mysqli_fetch_assoc($result);
  28.     }
  29.  
  30. }
  31.  
  32. if (!function_exists('mysql_fetch_array')) {
  33.  
  34.     function mysql_fetch_array($result)
  35.     {
  36.         if (is_null($mylink)) {
  37.             global $link;
  38.  
  39.         } else {
  40.             $link = $mylink;
  41.         }
  42.         return mysqli_fetch_array($result);
  43.     }
  44.  
  45. }
  46.  
  47. if (!function_exists('mysql_real_escape_string')) {
  48.  
  49.     function mysql_real_escape_string($string, $mylink = null)
  50.     {
  51.         if (is_null($mylink)) {
  52.             global $link;
  53.         } else {
  54.             $link = $mylink;
  55.         }
  56.  
  57.         return mysqli_real_escape_string($link, $string);
  58.     }
  59. }
  60.  
  61. if (!function_exists('mysql_result')) {
  62.  
  63.     function mysql_result($res, $row = 0, $col = 0)
  64.     {
  65.         $numrows = mysqli_num_rows($res);
  66.         if ($numrows && $row <= ($numrows - 1) && $row >= 0) {
  67.             mysqli_data_seek($res, $row);
  68.             $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
  69.             if (isset($resrow[$col])) {
  70.                 return $resrow[$col];
  71.             }
  72.         }
  73.         return false;
  74.     }
  75.     function mysqli_result($res, $row = 0, $col = 0)
  76.     {
  77.         $numrows = mysqli_num_rows($res);
  78.         if ($numrows && $row <= ($numrows - 1) && $row >= 0) {
  79.             mysqli_data_seek($res, $row);
  80.             $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
  81.             if (isset($resrow[$col])) {
  82.                 return $resrow[$col];
  83.             }
  84.         }
  85.         return false;
  86.     }
  87.  
  88. }
  89.  
  90. if (!function_exists('mysql_num_rows')) {
  91.  
  92.     function mysql_num_rows($result)
  93.     {
  94.         return mysqli_num_rows($result);
  95.     }
  96.  
  97. }
  98.  
  99. if (!function_exists('mysql_insert_id')) {
  100.  
  101.     function mysql_insert_id($link = null)
  102.     {
  103.         if (is_null($link)) {
  104.             global $link;
  105.         }
  106.  
  107.         return mysqli_insert_id($link);
  108.     }
  109.  
  110. }
  111.  
  112. if (!function_exists('mysql_error')) {
  113.  
  114.     function mysql_error()
  115.     {
  116.         global $link;
  117.         return mysqli_error($link);
  118.     }
  119.  
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement