PHP mysqli set_local_infile_handler()関数
定義と使用法
set_local_infile_handler()/ mysqli_set_local_infile_handler()関数は、LOAD DATA LOCALINFILEコマンドのコールバック関数を設定します。
コールバック関数のタスクは、LOAD DATA LOCAL INFILEで指定されたファイルから入力を読み取り、それをLOAD DATAINFILEで理解できる形式に再フォーマットすることです。
返されるデータは、LOADDATAで指定された形式と一致する必要があります。
構文
オブジェクト指向スタイル:
$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歳以上 |
❮PHPMySQLiリファレンス