Build your own database driven website 4th Edition Chapter 4, 'Connection'

Hello I am going through Build Your Own Database Driven Website 4th Edition, Chapter 4, the connection section
I have tried manually tweaking the code but nothing seems to work, I have even downloaded the code archive and moved the ‘connection’ folder within it to my apache2.2 htdocs folder and tried running it and all I get is the following error -
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2

I have changed the password section so I do not think that is the error, I have tried using both mysql_connect and mysqli_connect as stated in a previous thread.
I have created a .php document using the code -

<?php phpinfo(); ?>

and I have included the entire output via a notepad file attached with this thread.

My server is running PHP 5.2.17
I have checked my .ini file and made sure that the mysql extension is enabled

As far as I can see everything is configured corrected and working, but I still can’t seem to get past this error message.
I have tried changing the ‘localhost’ section, again as directed in a previous thread.

I have no idea what to do next, an if I can’t resolve this issue I will be unable to connect to my database.

Thank you in advance for any help or tips.

Hello all, I solved the problem after searching for hours online I found the following two sites -

http://uk.php.net/install.windows.manual
I removed C:\PHP and replaced it with “.\”
Then I moved my php.ini file into my apache2.2 directory
Then I copied and pasted the libmysql.dll file into my windows/system32 folder, I restarted apache and it worked I now get the message - Unable to locate the joke database. which is fine since my database has a different name.

I highly recommend reading through those two sites and if you are still having problems there are some links within them too that could be helpful.
It really helped me.
Thanks.

The way I understand it is that the ini file should be wherever the PHP folder extracts. I know you can move it to other places but I’m uncertain about the wisdom of moving it under the apache folder to be able to use relative routes.