?
Solved

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

Posted on 2008-11-05
11
Medium Priority
?
188 Views
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?
<?php 
 
		include ("carter.inc");
 
		$cxn = mysqli_connect($host,$user,$password,$database)
		or die ("couldn't connect to server");

Open in new window

0
Comment
Question by:brucegust
11 Comments
 
LVL 8

Assisted Solution

by:nahime
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
0
 
LVL 12

Accepted Solution

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

extension=php_mysqli.dll

and add an extra section called:

[mysqli]
mysqli.max_links=-1
mysqli.default_port=3306
mysqli.default_socket=
mysqli.default_host=
mysqli.default_user=
mysqli.default_pw=
0
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22888535
Did you install the mysqli extension from http://dev.mysql.com/downloads/connector/php/ in your extension dir?
0
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

by:jazzIIIlove
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.
0
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22888565
Guess you have MySQL 5...

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

right?
0
 

Assisted Solution

by:ngechu1
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.

0
 
LVL 11

Assisted Solution

by:jausions
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.
0
 
LVL 12

Expert Comment

by:jazzIIIlove
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..

0
 
LVL 11

Expert Comment

by:jausions
ID: 22889496
jazzIIIlove:

 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.
0
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22893428
jausions:
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...
0
 

Author Comment

by:brucegust
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.

Thanks!
0

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