Solved

mysqli_set_local_infile_handler error

Posted on 2010-08-25
4
576 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

809 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