The set_local_infile_handler() / mysqli_set_local_infile_handler() function sets a callback function for LOAD DATA LOCAL INFILE command.
The callback functions tasks are to read input from the file specified in LOAD DATA LOCAL INFILE, and to reformat it into the format understood by LOAD DATA INFILE.
The returned data must match the format specified in the LOAD DATA.
$mysqli -> set_local_infile_handler(
read_file)
mysqli_set_local_infile_handler(
read_file)
Parameter | Description |
---|---|
connection | Required. Specifies the MySQL connection to use |
read_func | Required. Specifies a callback function or objext that can take the following params: stream - A PHP stream associated with the SQL commands INFILE &buffer - A string buffer to store the rewritten input into buflen - The maximum number of characters to be stored in the buffer &erromsg - If an error occurs you can store an error message in here |
Return Value: | TRUE on success. FALSE on failure |
---|---|
PHP Version: | 5+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!