PHP mysqli: set_local_infile_default() function

mysqli_set_local_infile_default function / mysqli::set_local_infile_default

The mysqli_set_local_infile_default function / mysqli::set_local_infile_default — unsets user defined handler for load local infile command.




Name Description Required/Optional
connection Specifies the MySQL connection to use Required
charset Specifies the default character set Required

Return value:

No value is returned.

Version: PHP 5, PHP 7


$db = mysqli_init();

  function callme($stream, &$buffer, $buflen, &$errmsg)
    $buffer = fgets($stream);

    echo $buffer;

    // convert to upper case and replace "," delimiter with [TAB]
    $buffer = strtoupper(str_replace(",", "\t", $buffer));

    return strlen($buffer);

  echo "Input:\n";

  $db->query("LOAD DATA LOCAL INFILE 'input.txt' INTO TABLE t1");

  $res = $db->query("SELECT * FROM t1");

  echo "\nResult:\n";
  while ($row = $res->fetch_assoc()) {
    echo join(",", $row)."\n";

See also

PHP Function Reference

Previous: set_charset
Next: set_local_infile_handler

Follow us on Facebook and Twitter for latest update.