?
Solved

mysqli_set_local_infile_handler error

Posted on 2010-08-25
4
Medium Priority
?
612 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 2000 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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.
Suggested Courses

762 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