robb73 Posted April 13, 2007 Share Posted April 13, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/ Share on other sites More sharing options...
PC Nerd Posted April 13, 2007 Share Posted April 13, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228282 Share on other sites More sharing options...
robb73 Posted April 13, 2007 Author Share Posted April 13, 2007 oh god, really sorry I've posted in the wrong section and I'm not sure how to delete my topic? Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228287 Share on other sites More sharing options...
tauchai83 Posted April 13, 2007 Share Posted April 13, 2007 you just need to set the mysqli class...by default, it is off . You can google it out the steps in setting the class. It basically involve changing the php.ini file.... Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228297 Share on other sites More sharing options...
robb73 Posted April 13, 2007 Author Share Posted April 13, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228305 Share on other sites More sharing options...
tauchai83 Posted April 13, 2007 Share Posted April 13, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228320 Share on other sites More sharing options...
robb73 Posted April 13, 2007 Author Share Posted April 13, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228330 Share on other sites More sharing options...
tauchai83 Posted April 13, 2007 Share Posted April 13, 2007 check about this: ; Directory in which the loadable extensions (modules) reside. extension_dir = "C:\xxx\php5\ext" Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228331 Share on other sites More sharing options...
robb73 Posted April 13, 2007 Author Share Posted April 13, 2007 Yes, I did that, it reads as follows: ; Directory in which the loadable extensions (modules) reside. extension_dir = "C:/php/ext" Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228334 Share on other sites More sharing options...
tauchai83 Posted April 13, 2007 Share Posted April 13, 2007 are you still getting the same error? Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228354 Share on other sites More sharing options...
robb73 Posted April 13, 2007 Author Share Posted April 13, 2007 Yes Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228364 Share on other sites More sharing options...
robb73 Posted April 13, 2007 Author Share Posted April 13, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228579 Share on other sites More sharing options...
wildteen88 Posted April 13, 2007 Share Posted April 13, 2007 Have a read of this FAQ. Note that enables the standard mysql extension. For mysqli replace php_mysql.dll with php_mysqli.dll Also I will move this to the Installation board. Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-228828 Share on other sites More sharing options...
robb73 Posted April 14, 2007 Author Share Posted April 14, 2007 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... Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-229106 Share on other sites More sharing options...
wildteen88 Posted April 14, 2007 Share Posted April 14, 2007 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) Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-229109 Share on other sites More sharing options...
robb73 Posted April 14, 2007 Author Share Posted April 14, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-229112 Share on other sites More sharing options...
robb73 Posted April 15, 2007 Author Share Posted April 15, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/46836-solved-call-to-undefined-function-mysqli_connect/#findComment-229646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.