Subversion Repositories prepend

Rev

Rev 8 | Rev 10 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. // TODO: test everything
  4. // TODO: return values?
  5. // TODO: check if we matched all stuff mentioned here: https://www.phpclasses.org/blog/package/9199/post/3-Smoothly-Migrate-your-PHP-Code-using-the-Old-MySQL-extension-to-MySQLi.html
  6. // TODO: translate descriptions to english
  7.  
  8. $xxx_vts_prepend_config = array();
  9. if (file_exists($xxx_vts_prepend_config_file = __DIR__.'/config.local.php')) include $xxx_vts_prepend_config_file;
  10. unset($xxx_vts_prepend_config_file);
  11. $xxx_directories_need_mysql = $xxx_vts_prepend_config['directories_need_mysql'];
  12. unset($xxx_vts_prepend_config);
  13.  
  14. $xxx_go = false;
  15. foreach ($xxx_directories_need_mysql as $xxx_directory_need_mysql) {
  16.         if ($xxx_negate = (substr($xxx_directory_need_mysql,0,1) === '!')) {
  17.                 $xxx_directory_need_mysql = substr($xxx_directory_need_mysql,1);
  18.         }
  19.         if (strpos($_SERVER['SCRIPT_FILENAME'], $xxx_directory_need_mysql) === 0) {
  20.                 $xxx_go = !$xxx_negate;
  21.         }
  22.         unset($xxx_negate);
  23. }
  24. unset($xxx_directories_need_mysql);
  25. unset($xxx_directory_need_mysql);
  26.  
  27. if ($xxx_go && !function_exists('mysql_connect')) {
  28.  
  29.         $vts_mysqli = null;
  30.         $vts_mysqli_report_set_once = false;
  31.  
  32.         // Liefert die Anzahl betroffener Datensätze einer vorhergehenden MySQL Operation
  33.         function mysql_affected_rows($link_identifier=NULL) {
  34.                 global $vts_mysqli;
  35.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  36.                 if (is_null($li)) throw new Exception("Cannot execute mysql_affected_rows(). No valid connection to server.");
  37.                 return $li->affected_rows;
  38.         }
  39.  
  40.         // Liefert den Namen des Zeichensatzes
  41.         function mysql_client_encoding($link_identifier=NULL) {
  42.                 global $vts_mysqli;
  43.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  44.                 if (is_null($li)) throw new Exception("Cannot execute mysql_client_encoding(). No valid connection to server.");
  45.                 return $li->character_set_name();
  46.         }
  47.  
  48.         // Schließt eine Verbindung zu MySQL
  49.         function mysql_close($link_identifier=NULL) {
  50.                 global $vts_mysqli;
  51.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  52.                 if (is_null($li)) throw new Exception("Cannot execute mysql_close(). No valid connection to server.");
  53.                 return $li->close();
  54.         }
  55.  
  56.         // Öffnet eine Verbindung zu einem MySQL-Server
  57.         function mysql_connect($server=null, $username=null, $password=null, $new_link=false, $client_flags=0) {
  58.                 global $vts_mysqli;
  59.                 global $vts_mysqli_report_set_once;
  60.                 $ary = explode(':', $server);
  61.                 $host = $ary[0];
  62.                 $ini_port = ini_get("mysqli.default_port");
  63.                 $port = isset($ary[1]) ? (int)$ary[1] : ($ini_port ? (int)$ini_port : 3306);
  64.                 if (is_null($server)) $port = ini_get("mysqli.default_host");
  65.                 if (is_null($username)) $port = ini_get("mysqli.default_user");
  66.                 if (is_null($password)) $port = ini_get("mysqli.default_password");
  67.                 $vts_mysqli = new mysqli($host, $username, $password, /*dbname*/'', $port, ini_get("mysqli.default_socket"));
  68.                 if (!$vts_mysqli_report_set_once) {
  69.                         mysqli_report(MYSQLI_REPORT_OFF); // PHP <8.1 compatibility
  70.                         $vts_mysqli_report_set_once = true;
  71.                 }
  72.                 return (empty($vts_mysqli->connect_error) && ($vts_mysqli->connect_errno == 0)) ? $vts_mysqli : false;
  73.         }
  74.  
  75.         // Anlegen einer MySQL-Datenbank
  76.         function mysql_create_db($database_name, $link_identifier=NULL) {
  77.                 global $vts_mysqli;
  78.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  79.                 if (is_null($li)) throw new Exception("Cannot execute mysql_create_db(). No valid connection to server.");
  80.                 return mysql_query("CREATE DATABASE `$database_name`", $li) !== false;
  81.         }
  82.  
  83.         // Bewegt den internen Ergebnis-Zeiger
  84.         function mysql_data_seek($result, $row_number) {
  85.                 if (!$result) {
  86.                         $err = mysql_error();
  87.                         throw new Exception("Called mysql_data_seek() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  88.                 }
  89.                 return $result->data_seek($row_number) !== false;
  90.         }
  91.  
  92.         // Liefert Schema Namen vom Aufruf von mysql_list_dbs
  93.         function mysql_db_name($result, $row, $field=NULL) {
  94.                 if (!$result) {
  95.                         $err = mysql_error();
  96.                         throw new Exception("Called mysql_db_name() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  97.                 }
  98.                 $result->data_seek($row);
  99.                 return mysql_fetch_array($result)[is_null($field) ? 0 : $field];
  100.         }
  101.  
  102.         // Selektiert ein Schema und führt in ihm Anfrage aus
  103.         function mysql_db_query($database, $query, $link_identifier=NULL) {
  104.                 global $vts_mysqli;
  105.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  106.                 if (is_null($li)) throw new Exception("Cannot execute mysql_db_query(). No valid connection to server.");
  107.                 mysql_select_db($database, $li);
  108.                 return mysql_query($query, $li);
  109.                 // Note: The mysql_*() implementation defines, that we will not jump back to our original DB
  110.         }
  111.  
  112.         // Löschen eines Schemas
  113.         function mysql_drop_db($database_name, $link_identifier=NULL) {
  114.                 global $vts_mysqli;
  115.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  116.                 if (is_null($li)) throw new Exception("Cannot execute mysql_drop_db(). No valid connection to server.");
  117.                 return mysql_query("DROP DATABASE `$database_name`", $li) !== false;
  118.         }
  119.  
  120.         // Liefert die Nummer einer Fehlermeldung einer zuvor ausgeführten MySQL Operation
  121.         function mysql_errno($link_identifier=NULL) {
  122.                 global $vts_mysqli;
  123.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  124.                 if (is_null($li)) throw new Exception("Cannot execute mysql_errno(). No valid connection to server.");
  125.                 return !empty($li->connect_errno) ? $li->connect_errno : $li->errno;
  126.         }
  127.  
  128.         // Liefert den Fehlertext der zuvor ausgeführten MySQL Operation
  129.         function mysql_error($link_identifier=NULL) {
  130.                 global $vts_mysqli;
  131.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  132.                 if (is_null($li)) throw new Exception("Cannot execute mysql_error(). No valid connection to server.");
  133.                 return !empty($li->connect_error) ? $li->connect_error : $li->error;
  134.         }
  135.  
  136.         // Maskiert einen String zur Benutzung in einer MySQL Abfrage
  137.         function mysql_escape_string($unescaped_string) {
  138.                 global $vts_mysqli;
  139.                 return $vts_mysqli->real_escape_string($unescaped_string);
  140.         }
  141.  
  142.         // Liefert einen Datensatz als assoziatives Array, als numerisches Array oder beides
  143.         define('MYSQL_ASSOC', MYSQLI_ASSOC);
  144.         define('MYSQL_NUM',   MYSQLI_NUM);
  145.         define('MYSQL_BOTH',  MYSQLI_BOTH);
  146.         function mysql_fetch_array($result, $result_type=MYSQL_BOTH) {
  147.                 if (!$result) {
  148.                         $err = mysql_error();
  149.                         throw new Exception("Called mysql_fetch_array() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  150.                 }
  151.                 return $result->fetch_array($result_type);
  152.         }
  153.  
  154.         // Liefert einen Datensatz als assoziatives Array
  155.         function mysql_fetch_assoc($result) {
  156.                 if (!$result) {
  157.                         $err = mysql_error();
  158.                         throw new Exception("Called mysql_fetch_assoc() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  159.                 }
  160.                 return $result->fetch_assoc();
  161.         }
  162.  
  163.         // Liefert ein Objekt mit Feldinformationen aus einem Anfrageergebnis
  164.         function mysql_fetch_field($result, $field_offset=0) {
  165.                 if (!$result) {
  166.                         $err = mysql_error();
  167.                         throw new Exception("Called mysql_fetch_field() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  168.                 }
  169.                 return $result->fetch_field();
  170.         }
  171.  
  172.         // Liefert die Länge eines jeden Feldes in einem Ergebnis
  173.         function mysql_fetch_lengths($result) {
  174.                 if (!$result) {
  175.                         $err = mysql_error();
  176.                         throw new Exception("Called mysql_fetch_lengths() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  177.                 }
  178.                 return $result->lengths;
  179.         }
  180.  
  181.         // Liefert eine Ergebniszeile als Objekt
  182.         function mysql_fetch_object($result, $class_name="stdClass", $params=null) {
  183.                 if (!$result) {
  184.                         $err = mysql_error();
  185.                         throw new Exception("Called mysql_fetch_object() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  186.                 }
  187.                 if ($params) {
  188.                         return $result->fetch_object($class_name, $params);
  189.                 } else {
  190.                         return $result->fetch_object($class_name);
  191.                 }
  192.         }
  193.  
  194.         // Liefert einen Datensatz als indiziertes Array
  195.         function mysql_fetch_row($result) {
  196.                 if (!$result) {
  197.                         $err = mysql_error();
  198.                         throw new Exception("Called mysql_fetch_row() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  199.                 }
  200.                 return $result->fetch_row();
  201.         }
  202.  
  203.         // Liefert die Flags des spezifizierten Feldes in einem Anfrageergebnis
  204.         function mysql_field_flags($result, $field_offset) {
  205.                 if (!$result) {
  206.                         $err = mysql_error();
  207.                         throw new Exception("Called mysql_field_flags() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  208.                 }
  209.                 return $result->fetch_field_direct($field_offset)->flags;
  210.         }
  211.  
  212.         // Liefert die Länge des angegebenen Feldes
  213.         function mysql_field_len($result, $field_offset) {
  214.                 if (!$result) {
  215.                         $err = mysql_error();
  216.                         throw new Exception("Called mysql_field_len() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  217.                 }
  218.                 return $result->fetch_field_direct($field_offset)->length;
  219.         }
  220.  
  221.         // Liefert den Namen eines Feldes in einem Ergebnis
  222.         function mysql_field_name($result, $field_offset) {
  223.                 if (!$result) {
  224.                         $err = mysql_error();
  225.                         throw new Exception("Called mysql_field_name() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  226.                 }
  227.                 return $result->fetch_field_direct($field_offset)->name; //or "orgname"
  228.         }
  229.  
  230.         // Setzt den Ergebniszeiger auf ein bestimmtes Feldoffset
  231.         function mysql_field_seek($result, $field_offset) {
  232.                 if (!$result) {
  233.                         $err = mysql_error();
  234.                         throw new Exception("Called mysql_field_seek() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  235.                 }
  236.                 return $result->field_seek($field_offset);
  237.         }
  238.  
  239.         // Liefert den Namen der Tabelle, die das genannte Feld enthält
  240.         function mysql_field_table($result, $field_offset) {
  241.                 if (!$result) {
  242.                         $err = mysql_error();
  243.                         throw new Exception("Called mysql_field_table() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  244.                 }
  245.                 return $result->fetch_field_direct($field_offset)->table; // or "orgtable"
  246.         }
  247.  
  248.         // Liefert den Typ des spezifizierten Feldes in einem Ergebnis
  249.         function mysql_field_type($result, $field_offset) {
  250.                 if (!$result) {
  251.                         $err = mysql_error();
  252.                         throw new Exception("Called mysql_field_type() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  253.                 }
  254.                 return $result->fetch_field_direct($field_offset)->type;
  255.         }
  256.  
  257.         // Gibt belegten Speicher wieder frei
  258.         function mysql_free_result($result) {
  259.                 if (!$result) {
  260.                         $err = mysql_error();
  261.                         throw new Exception("Called mysql_free_result() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  262.                 }
  263.                 return $result->free();
  264.         }
  265.  
  266.         // Liefert MySQL Clientinformationen
  267.         function mysql_get_client_info() {
  268.                 global $vts_mysqli;
  269.                 return $vts_mysqli->get_client_info();
  270.         }
  271.  
  272.         // Liefert MySQL Host Informationen
  273.         function mysql_get_host_info($link_identifier=NULL) {
  274.                 global $vts_mysqli;
  275.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  276.                 if (is_null($li)) throw new Exception("Cannot execute mysql_get_host_info(). No valid connection to server.");
  277.                 return $li->host_info;
  278.         }
  279.  
  280.         // Liefert MySQL Protokollinformationen
  281.         function mysql_get_proto_info($link_identifier=NULL) {
  282.                 global $vts_mysqli;
  283.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  284.                 if (is_null($li)) throw new Exception("Cannot execute mysql_get_proto_info(). No valid connection to server.");
  285.                 return $li->protocol_version;
  286.         }
  287.  
  288.         // Liefert MySQL Server Informationen
  289.         function mysql_get_server_info($link_identifier=NULL) {
  290.                 global $vts_mysqli;
  291.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  292.                 if (is_null($li)) throw new Exception("Cannot execute mysql_get_server_info(). No valid connection to server.");
  293.                 return $li->server_info;
  294.         }
  295.  
  296.         // Liefert Informationen über die zuletzt ausgeführte Anfrage zurück
  297.         function mysql_info($link_identifier=NULL) {
  298.                 global $vts_mysqli;
  299.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  300.                 if (is_null($li)) throw new Exception("Cannot execute mysql_info(). No valid connection to server.");
  301.                 return $li->info;
  302.         }
  303.  
  304.         // Liefert die ID, die in der vorherigen Abfrage erzeugt wurde
  305.         function mysql_insert_id($link_identifier=NULL) {
  306.                 global $vts_mysqli;
  307.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  308.                 if (is_null($li)) throw new Exception("Cannot execute mysql_insert_id(). No valid connection to server.");
  309.                 return $li->insert_id;
  310.         }
  311.  
  312.         // Auflistung der verfügbaren Datenbanken (Schemata) auf einem MySQL Server
  313.         function mysql_list_dbs($link_identifier=NULL) {
  314.                 global $vts_mysqli;
  315.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  316.                 if (is_null($li)) throw new Exception("Cannot execute mysql_list_dbs(). No valid connection to server.");
  317.                 return mysql_query('SHOW DATABASES', $li);
  318.         }
  319.  
  320.         // Listet MySQL Tabellenfelder auf
  321.         function mysql_list_fields($database_name, $table_name, $link_identifier=NULL) {
  322.                 global $vts_mysqli;
  323.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  324.                 if (is_null($li)) throw new Exception("Cannot execute mysql_list_fields(). No valid connection to server.");
  325.                 return mysql_query("SHOW COLUMNS FROM `$database_name`.`$table_name`", $li);
  326.         }
  327.  
  328.         // Zeigt die MySQL Prozesse an
  329.         function mysql_list_processes($link_identifier=NULL) {
  330.                 global $vts_mysqli;
  331.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  332.                 if (is_null($li)) throw new Exception("Cannot execute mysql_list_processes(). No valid connection to server.");
  333.                 return $li->thread_id;
  334.         }
  335.  
  336.         // Listet Tabellen in einer MySQL Datenbank auf
  337.         function mysql_list_tables($database, $link_identifier=NULL) {
  338.                 global $vts_mysqli;
  339.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  340.                 if (is_null($li)) throw new Exception("Cannot execute mysql_list_tables(). No valid connection to server.");
  341.                 return mysql_query("SHOW TABLES FROM `$database`", $li);
  342.         }
  343.  
  344.         // Liefert die Anzahl der Felder in einem Ergebnis
  345.         function mysql_num_fields($result) {
  346.                 if (!$result) {
  347.                         $err = mysql_error();
  348.                         throw new Exception("Called mysql_num_fields() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  349.                 }
  350.                 global $vts_mysqli;
  351.                 return $vts_mysqli->field_count;
  352.         }
  353.  
  354.         // Liefert die Anzahl der Zeilen im Ergebnis
  355.         function mysql_num_rows($result) {
  356.                 if (!$result) {
  357.                         $err = mysql_error();
  358.                         throw new Exception("Called mysql_num_rows() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  359.                 }
  360.                 return $result->num_rows;
  361.         }
  362.  
  363.         // Öffnet eine persistente Verbindung zum MySQL Server
  364.         function mysql_pconnect($server=null, $username=null, $password=null, $client_flags=0) {
  365.                 global $vts_mysqli;
  366.                 $ary = explode(':', $server);
  367.                 $host = $ary[0];
  368.                 $ini_port = ini_get("mysqli.default_port");
  369.                 $port = isset($ary[1]) ? (int)$ary[1] : ($ini_port ? (int)$ini_port : 3306);
  370.                 if (is_null($server)) $port = ini_get("mysqli.default_host");
  371.                 if (is_null($username)) $port = ini_get("mysqli.default_user");
  372.                 if (is_null($password)) $port = ini_get("mysqli.default_password");
  373.                 $vts_mysqli = new mysqli('p:'.$host, $username, $password, /*dbname*/'', $port, ini_get("mysqli.default_socket"));
  374.                 return (empty($vts_mysqli->connect_error) && ($vts_mysqli->connect_errno == 0)) ? $vts_mysqli : false;
  375.         }
  376.  
  377.         // Ping a server connection or reconnect if there is no connection
  378.         function mysql_ping($link_identifier=NULL) {
  379.                 global $vts_mysqli;
  380.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  381.                 if (is_null($li)) throw new Exception("Cannot execute mysql_ping(). No valid connection to server.");
  382.                 return $li->ping();
  383.         }
  384.  
  385.         // Sendet eine Anfrage an MySQL
  386.         function mysql_query($query, $link_identifier=NULL) {
  387.                 global $vts_mysqli;
  388.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  389.                 if (is_null($li)) throw new Exception("Cannot execute mysql_query(). No valid connection to server.");
  390.                 return $li->query($query, $resultmode=MYSQLI_STORE_RESULT);
  391.         }
  392.  
  393.         // Maskiert spezielle Zeichen innerhalb eines Strings für die Verwendung in einer SQL-Anweisung
  394.         function mysql_real_escape_string($unescaped_string, $link_identifier=NULL) {
  395.                 global $vts_mysqli;
  396.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  397.                 if (is_null($li)) throw new Exception("Cannot execute mysql_real_escape_string(). No valid connection to server.");
  398.                 return $li->escape_string($unescaped_string);
  399.         }
  400.  
  401.         // Liefert Ergebnis
  402.         function mysql_result($result, $row, $field=0) {
  403.                 if (!$result) {
  404.                         $err = mysql_error();
  405.                         throw new Exception("Called mysql_result() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  406.                 }
  407.                 $result->data_seek($row);
  408.                 return mysql_fetch_array($result)[$field];
  409.         }
  410.  
  411.         // Auswahl einer MySQL Datenbank
  412.         function mysql_select_db($database_name, $link_identifier=NULL) {
  413.                 global $vts_mysqli;
  414.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  415.                 if (is_null($li)) throw new Exception("Cannot execute mysql_select_db(). No valid connection to server.");
  416.                 return $li->select_db($database_name);
  417.         }
  418.  
  419.         // Setzt den Verbindungszeichensatz
  420.         function mysql_set_charset($charset, $link_identifier=NULL) {
  421.                 global $vts_mysqli;
  422.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  423.                 if (is_null($li)) throw new Exception("Cannot execute mysql_set_charset(). No valid connection to server.");
  424.                 return $li->set_charset($charset);
  425.         }
  426.  
  427.         // Zeigt den momentanen Serverstatus an
  428.         function mysql_stat($link_identifier=NULL) {
  429.                 global $vts_mysqli;
  430.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  431.                 if (is_null($li)) throw new Exception("Cannot execute mysql_stat(). No valid connection to server.");
  432.                 return $li->stat();
  433.         }
  434.  
  435.         // Liefert den Namen einer Tabelle
  436.         function mysql_tablename($result, $i) {
  437.                 if (!$result) {
  438.                         $err = mysql_error();
  439.                         throw new Exception("Called mysql_tablename() with an erroneous argument.".($err == '' ? '' : " Possible cause: $err"));
  440.                 }
  441.                 $result->data_seek($i);
  442.                 return mysql_fetch_array($result)[0];
  443.         }
  444.  
  445.         // Zeigt die aktuelle Thread ID an
  446.         function mysql_thread_id($link_identifier=NULL) {
  447.                 global $vts_mysqli;
  448.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  449.                 if (is_null($li)) throw new Exception("Cannot execute mysql_thread_id(). No valid connection to server.");
  450.                 return $li->thread_id;
  451.         }
  452.  
  453.         // Sendet eine SQL Anfrage an MySQL, ohne Ergebniszeilen abzuholen und zu puffern
  454.         function mysql_unbuffered_query($query, $link_identifier=NULL) {
  455.                 global $vts_mysqli;
  456.                 $li = is_null($link_identifier) ? $vts_mysqli : $link_identifier;
  457.                 if (is_null($li)) throw new Exception("Cannot execute mysql_unbuffered_query(). No valid connection to server.");
  458.                 // http://php.net/manual/de/mysqlinfo.concepts.buffering.php
  459.                 // https://stackoverflow.com/questions/1982016/unbuffered-query-with-mysqli?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
  460.                 $li->real_query($query);
  461.                 $li->use_result();
  462.         }
  463.  
  464. }
  465. unset($xxx_directories_need_mysql);
  466. unset($xxx_directory_need_mysql);
  467.