Current Location: Home> Function Categories> set_local_infile_handler

set_local_infile_handler

Sets the callback function for the LOAD DATA LOCAL INFILE command.
Name:set_local_infile_handler
Category:Uncategorized
Programming Language:php
One-line Description:Sets the callback function for the LOAD DATA LOCAL INFILE command.

Definition and usage

The set_local_infile_handler() / mysqli_set_local_infile_handler() function sets the callback function for the LOAD DATA LOCAL INFILE command.

The task of the callback function is to read input from the file specified in LOAD DATA LOCAL INFILE and reformat it to a format understood by LOAD DATA INFILE.

The returned data must match the format specified in LOAD DATA.

grammar

Object-oriented style:

 $mysqli -> set_local_infile_handler ( read_file )

Procedural Style:

 mysqli_set_local_infile_handler ( read_file )
parameter describe
connection Required. Specify the MySQL connection to use
read_func

Required. Specifies a callback function or object that can accept the following parameters:

  • stream - PHP stream associated with SQL command INFILE
  • &buffer - String buffer used to store rewrite input
  • buflen - The maximum number of characters stored in the buffer
  • &erromsg - If an error occurs, an error message can be stored here
Similar Functions
Popular Articles