set_local_infile_handler() / mysqli_set_local_infile_handler() 函数为 LOAD DATA LOCAL INFILE 命令设置回调函数。
回调函数的任务是从 LOAD DATA LOCAL INFILE 中指定的文件读取输入,并将其重新格式化为 LOAD DATA INFILE 可以理解的格式。
返回的数据必须与 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 |
返回值: | 成功则为真。失败时为 FALSE |
---|---|
PHP 版本: | 5+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!