Jump to content

[SOLVED] Call to undefined function mysqli_connect()


Recommended Posts

Unfortunately I can't get mysqli to work, I keep getting the

error message "Call to undefined function mysqli_connect()".

 

As everything works fine using mysql I am guessing its something to do with

my php install?

 

I'm using:

 

Windows xp pro sp2

IIS

PHP 5.1.2

MySQL 5.0.27

 

I have included extension=php_mysql.dll in the php.ini (in the WINDOWS folder).

I have also checked the extension to the extension directory extension_dir = "C:/php/ext"

 

The libmysql.dll is in the SYSTEM32 folder.

 

Bizarrely, when I check the version of Mysql using phpinfo() the version shown is 4.1.7

yet when using the MySQL command line client it shows 5.0.27.

 

Rob

Link to comment
Share on other sites

um, ph installation board.... ???

 

 

i dont know muchb about manually installing php etc, but download xampp,  its like a pre packaged version of everything........

 

it might take you abotu half an hour to an hour to install and sopy over your scripts........ simply export your current database through SQL, and import if in the new one

 

let us know if it works,

 

PC Nerd

Link to comment
Share on other sites

hi,

 

I'm not sure what that is? Is it the section in the php.ini file which starts with [MySQLi]?

 

I have also just looked again at the php manual XCIX. MySQL Improved Extension, but couldn't find anything mentioning mysqli class?

 

Sorry, I'm being a thicko!

Link to comment
Share on other sites

ok. Easiest way.

 

You type "Call to undefined function mysqli_connect()" in google textbox. Done. I guarantee you will find the solution. You need to set the Mysqli class. If ON, It will be displayed on the php info page, right after the Mysql class.

 

Thank You.

 

 

Link to comment
Share on other sites

I googled that before coming on this forum and followed several threads on forums to see what others had done.

 

I had already added extension=php_mysqli.dll and it is not commented out, if this is what you mean by setting the mysqli class?

 

If this is not the mysqli class, then I'm now completely lost  :(

 

 

 

 

Link to comment
Share on other sites

I used the Windows installer from php.net, and have just found the following:

 

Note:  While the Windows installer is an easy way to make PHP work, it is restricted in many aspects as, for example, the automatic setup of extensions is not supported. Use of the installer isn't the preferred method for installing PHP.

 

 

If I have manually inserted the mysqli extension and ensured all the directories are in the right place, I'm not sure why it would make a difference, but just a thought.

Link to comment
Share on other sites

Thanks for the link, I have checked through the details in the post you provided and everything concurs with my set-up.

 

I should point out again that querying the the database using the mysql_ functions works, and that all I'm trying to do is make available the newer mysqli_ functions.

 

I have checked and double checked file locations and directory paths and everything is set up correctly, which is why this is all so frustrating.

 

I don't think there is anything more I can do...  :(

Link to comment
Share on other sites

What version of PHP are you using. MySQL Improved is only available for PHP5 or greater.

 

Also ensure that extension exists in the extension folder and that it was built for the version of PHP you have. You can check the build of the extension by right clicking the file and selecting properties form the content menu and selecting the version tab. File Version should match the exact version of PHP you have installed.

 

If you have the standard mysql extension enabled then themysql improved extension should also work as both extensions use the same external library (libmysql.dll)

Link to comment
Share on other sites

Hi wildteen88,

 

I'm using 5.1.2, the mysqli extension is present in the extension folder and has the same version number as PHP.

 

I would re-install everything, but I can't help thinking that if everything is in the right place already what good that would do.

 

 

 

 

 

Link to comment
Share on other sites

In the end I couldn't see any reason why it wasn't working, so I removed PHP completely,

and this time manually installed the latest version, added the PHP directory to PATH and

kept everything in the C:/php directory instead of the WINDOWS and SYSTEM32 folders.

 

Needless to say everything is working fine now, and just want to say thanks to everyone who helped.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.