Build your own Database Driven Website, Chapter 4

I’m in Chapter 4 (page 121, 4th edition). I am trying to connect to my database for the first time through my webbrowser/php.

I receive the following error when I try to connect my page with my jokes database:

Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2

I have tried manually creating the code and also copying the provided code from the text book.

I have verified that I have the mysqli library compiled into php, also when I check my apache server is says its running and it shows on the bottom Apache/2.2.16(win32) PHP/5.2.14.

I am a real beginner and I have been struggling with this for a little while, and looking through previous threads on the topic. However nothing seems to have fixed this for me, and whatever I try I get the same error as above.

Any help would be greatly appreciated

Many Thanks

Hi SpacePhoenix, thanks for the quick reply, I checked other posts on the forums this is one of the suggested solutions, I have checked that the ; was removed from the beginning of that line, I restarted the server and I am still getting the same error.

I really appreciate the help, do you have any other ideas as to what could be causing the problem?

In your php.ini file you will have a line which probably looks like this:

;extension=php_mysqli.dll
The ; at the start of the line means that the extension (in this case the mysqli extension) has been disabled. Remove the ; from that line, save the file then reboot the server.