Doc #77786 [Com]: set_local_infile_handler and set_local_infile_default methods of MySQLi

From: Date: Thu, 02 May 2019 12:20:55 +0000
Subject: Doc #77786 [Com]: set_local_infile_handler and set_local_infile_default methods of MySQLi
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16627@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77786&edit=1 ID: 77786 Comment by: vharihar at gmail dot com Reported by: museyib dot e at gmail dot com Summary: set_local_infile_handler and set_local_infile_default methods of MySQLi Status: Verified Type: Documentation Problem Package: MySQLi related Operating System: Kali kali-rolling (x86-64) PHP Version: 7.3.3 Block user comment: N Private report: N New Comment: Is there a replacement function? This seems to be a useful function to have. Previous Comments: ------------------------------------------------------------------------ [2019-03-24 18:04:30] cmb@php.net These methods (and the corresponding functions) have been removed[1], but the docs have not been updated accordingly. Also, it has been overlooked to remove the declarations[2]. [1] <http://git.php.net/?p=php-src.git;a=commit;h=522595086b8d654a2fd954977f7f443f2578de22> [2] <https://github.com/php/php-src/blob/php-7.3.4RC1/ext/mysqli/mysqli_fe.h#L71-L72> ------------------------------------------------------------------------ [2019-03-23 17:38:32] museyib dot e at gmail dot com Description: ------------ --- From manual page: https://php.net/mysqli.set-local-infile-handler --- An error occurs at the methods "set_local_infile_handler" and "set_local_infile_default" of MySQLi class. Even the code sample in PHP documentation does not work. Test script: --------------- <?php $db = mysqli_init(); $db->real_connect("localhost","root","","test"); function callme($stream, &$buffer, $buflen, &$errmsg) { $buffer = fgets($stream); echo $buffer; $buffer = strtoupper(str_replace(",", "\t", $buffer)); return strlen($buffer); } echo "Input:\n"; $db->set_local_infile_handler("callme"); $db->query("LOAD DATA LOCAL INFILE 'input.txt' INTO TABLE t1"); $db->set_local_infile_default(); $res = $db->query("SELECT * FROM t1"); echo "\nResult:\n"; while ($row = $res->fetch_assoc()) { echo join(",", $row)."\n"; } ?> Expected result: ---------------- I expect that code will work successfully? it doesn't matter what resalt is. Actual result: -------------- But this error appears: Fatal error: Uncaught Error: Call to undefined method mysqli::set_local_infile_handler() ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77786&edit=1

« previous php.doc.bugs (#16627) next »