Solved

mysqli_set_local_infile_handler error

Posted on 2010-08-25
4
598 Views
Last Modified: 2013-12-13
I am trying to use mysqli and I am getting this error:

Call to undefined function mysqli_set_local_infile_handler() in C:\Inetpub\wwwroot\index.php


I got this code from php.net:

$db = mysqli_init();
mysqli_real_connect($db, "localhost","root","","dbname");

if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
else
{
echo "Connection established!";
}



function callme($stream, &$buffer, $buflen, &$errmsg)
{
$buffer = fgets($stream);


echo $buffer;

// convert to upper case and replace "," delimiter with [TAB]
$buffer = strtoupper(str_replace(",", "\t", $buffer));

return strlen($buffer);
}


echo "Input:\n";

mysqli_set_local_infile_handler($db, "callme");
/*mysqli_query($db, "LOAD DATA LOCAL INFILE 'input.csv' INTO TABLE t1");
mysqli_set_local_infile_default($db);
0
Comment
Question by:bigjdve
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 33521773
You never defined the function my_sqli... Near the bottom of your code. You are calling a function you did not write so it's complaining.
0
 
LVL 3

Author Comment

by:bigjdve
ID: 33521881
Which function didn't I define?
0
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 500 total points
ID: 33523386
mysqli_set_local_infile_handler(

You have to first define it.
0
 
LVL 3

Author Closing Comment

by:bigjdve
ID: 33664221
Define the handler and it work
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question