Call to undefined function...What does this mean?

Posted on 2008-11-05
Medium Priority
Last Modified: 2013-12-13
If you head out to the page I have referenced, you'll get an error which I don't recognize or understand.

The code that the message is referring to is posted below. Line 17 is the "mysqli_connect" line.

What am I do doing wrong?
		include ("carter.inc");
		$cxn = mysqli_connect($host,$user,$password,$database)
		or die ("couldn't connect to server");

Open in new window

Question by:brucegust

Assisted Solution

nahime earned 400 total points
ID: 22888519
That the function mysqli_connect doesn't exists in your system.
Maybe the mysqli extension isn't installed.
See http://it2.php.net/manual/it/book.mysqli.php for a reference about it
LVL 12

Accepted Solution

jazzIIIlove earned 1000 total points
ID: 22888525
you should be able to work with mysqli with this changes:


and add an extra section called:

LVL 12

Expert Comment

ID: 22888535
Did you install the mysqli extension from http://dev.mysql.com/downloads/connector/php/ in your extension dir?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 12

Assisted Solution

jazzIIIlove earned 1000 total points
ID: 22888558
try the following only if you have php5 installed

you need to take the php.ini out of the windows directory and place it in the c:\php directory.

also you need to set the paths to c:\php in the environment variables.

then you need to copy libmysql.dll from c:\php to the windows directory

then you need to restart

If no use:

if you are still unable to connect to mysql, get the php package you are using and then use windows search to find ALL libmysql.dll files on your computer, then delete those that are (stand) on your PATH and delete them. Then extract a brand new libmysql.dll file from the pa ckage to a dir in your PATH. Make sure it is really the same php version you are using.
LVL 12

Expert Comment

ID: 22888565
Guess you have MySQL 5...

The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above...


Assisted Solution

ngechu1 earned 200 total points
ID: 22888698
He/She is on a linux/unix box. Get your hosting people to compile php with mysqli.

That should do it.

LVL 11

Assisted Solution

jausions earned 400 total points
ID: 22888992
You obviously don't have the mysqli extension installed. You may have the regular mysql one though. So try changing mysqli_connect() into mysql_connect() (note the "i" difference.)

That being said, all the over method calls would need to be changed the same, and the existing code relies on features of the mysqli extensions, than you'd need to do more changes.

The best solution might be to get the PHP mysqli extension on you web server system. I don't know if that's possible for you. If not, you'll need to switch over to "regular" mysql PHP extension.
LVL 12

Expert Comment

ID: 22889135
>>You obviously don't have the mysqli extension installed. You may have the regular mysql one though. >>So try changing mysqli_connect() into mysql_connect() (note the "i" difference.)

Well no offense but maybe the server uploading has mysql server 5...so if the code is complicated...I won't recommend changing it but simply adding the extenseion...(even search and replace feature can do but still i hesitate...)

Best regards..

LVL 11

Expert Comment

ID: 22889496

 The "regular" (old) mysql PHP extension works perfectly fine with MySQL 4.1.3 and above.

Solving brucegust's question depends on 2 things: Can mysqli extension be installed? And, does the script use advanced features only available with mysqli?

If no features of mysqli (comparatively to mysql extension) is used, then removing the "i" would mostly work fine, even with MySQL 5 as the server.
LVL 12

Expert Comment

ID: 22893428
of course...but if the code is complicated rather i advice to have the extension...Let the asker decide...We will be informed soon i guess...

Author Comment

ID: 22915034
Hey, folks!

The problem was solved by getting my ISP to ensure that mysqli was installed. It wasn't, or at least it hadn't been activated. Once that was in place, all was made well.


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
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…
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 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