PHP mysqli set_local_infile_handler() Function

❮ PHP MySQLi Reference


Definition and Usage

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.


Syntax

Object oriented style:

$mysqli -> set_local_infile_handler(read_file)

Procedural style:

mysqli_set_local_infile_handler(read_file)

Parameter Values

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

Technical Details

Return Value: TRUE on success. FALSE on failure
PHP Version: 5+

❮ PHP MySQLi Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.