Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!function_exists('mysql_query')) {
- function mysql_query($query, $mylink = null)
- {
- if (is_null($mylink)) {
- global $link;
- } else {
- $link = $mylink;
- }
- return mysqli_query($link, $query);
- }
- }
- if (!function_exists('mysql_fetch_assoc')) {
- function mysql_fetch_assoc($result)
- {
- if (is_null($mylink)) {
- global $link;
- } else {
- $link = $mylink;
- }
- return mysqli_fetch_assoc($result);
- }
- }
- if (!function_exists('mysql_fetch_array')) {
- function mysql_fetch_array($result)
- {
- if (is_null($mylink)) {
- global $link;
- } else {
- $link = $mylink;
- }
- return mysqli_fetch_array($result);
- }
- }
- if (!function_exists('mysql_real_escape_string')) {
- function mysql_real_escape_string($string, $mylink = null)
- {
- if (is_null($mylink)) {
- global $link;
- } else {
- $link = $mylink;
- }
- return mysqli_real_escape_string($link, $string);
- }
- }
- if (!function_exists('mysql_result')) {
- function mysql_result($res, $row = 0, $col = 0)
- {
- $numrows = mysqli_num_rows($res);
- if ($numrows && $row <= ($numrows - 1) && $row >= 0) {
- mysqli_data_seek($res, $row);
- $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
- if (isset($resrow[$col])) {
- return $resrow[$col];
- }
- }
- return false;
- }
- function mysqli_result($res, $row = 0, $col = 0)
- {
- $numrows = mysqli_num_rows($res);
- if ($numrows && $row <= ($numrows - 1) && $row >= 0) {
- mysqli_data_seek($res, $row);
- $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
- if (isset($resrow[$col])) {
- return $resrow[$col];
- }
- }
- return false;
- }
- }
- if (!function_exists('mysql_num_rows')) {
- function mysql_num_rows($result)
- {
- return mysqli_num_rows($result);
- }
- }
- if (!function_exists('mysql_insert_id')) {
- function mysql_insert_id($link = null)
- {
- if (is_null($link)) {
- global $link;
- }
- return mysqli_insert_id($link);
- }
- }
- if (!function_exists('mysql_error')) {
- function mysql_error()
- {
- global $link;
- return mysqli_error($link);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement