• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

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

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
brucegust
Asked:
brucegust
5 Solutions
 
nahimeCommented:
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
 
jazzIIIloveCommented:
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
 
jazzIIIloveCommented:
Did you install the mysqli extension from http://dev.mysql.com/downloads/connector/php/ in your extension dir?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
jazzIIIloveCommented:
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
 
jazzIIIloveCommented:
Guess you have MySQL 5...

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

right?
0
 
ngechu1Commented:
He/She is on a linux/unix box. Get your hosting people to compile php with mysqli.

That should do it.

0
 
jausionsCommented:
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
 
jazzIIIloveCommented:
>>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
 
jausionsCommented:
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
 
jazzIIIloveCommented:
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
 
brucegustPHP DeveloperAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now