Solved

mysqli_set_local_infile_handler error

Posted on 2010-08-25
4
571 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 38

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 38

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to dynamically set the form action using jQuery.
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.

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now