PHP mysqli set_local_infile_handler() Funkcja
Definicja i użycie
Funkcja set_local_infile_handler() / mysqli_set_local_infile_handler() ustawia funkcję wywołania zwrotnego dla polecenia LOAD DATA LOCAL INFILE.
Zadania funkcji zwrotnych polegają na odczytaniu danych wejściowych z pliku określonego w LOAD DATA LOCAL INFILE i przeformatowaniu ich do formatu zrozumiałego przez LOAD DATA INFILE.
Zwracane dane muszą być zgodne z formatem określonym w LOAD DATA.
Składnia
Styl zorientowany obiektowo:
$mysqli ->
set_local_infile_handler(read_file)
Styl proceduralny:
mysqli_set_local_infile_handler(read_file)
Wartości parametrów
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 |
Szczegóły techniczne
Wartość zwrotu: | PRAWDA o sukcesie. FAŁSZ w przypadku niepowodzenia |
---|---|
Wersja PHP: | 5+ |
Dokumentacja PHP MySQLi