PHP mysqli set_local_infile_handler() 함수
정의 및 사용
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 |
기술적 세부 사항
반환 값: | 성공 시 TRUE입니다. 실패시 FALSE |
---|---|
PHP 버전: | 5+ |
❮ PHP MySQLi 참조