Solved

mysqli_set_local_infile_handler error

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

744 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

14 Experts available now in Live!

Get 1:1 Help Now