I've just started going through Chapter 4 in Build Your Own Database Driven Website Using PHP & MySQL and I've already run into some difficulties.
I tried running jokelist.php but I kept getting a blank page! I then removed the @ sign from the front of the mysql_connect function and got the following message:
Fatal error: Call to undefined function mysql_connect() in C:\Documents and Settings\.......
I'm guessing that you typed the code by hand instead of using the download code from the book, right? If so, you may just have a typo in your code. Go get the code from the code archive. It will save you a lot of debugging time.
you should probably check and ensure that php_mysql.dll exists. if it says the function isnt defined, it has nothing to do with your code, only your PHP installation.
And now the information in phpinfo.php is correct i.e. the correct folders are being displayed in the 'Configuration File (php.ini) Path' field and in the 'extension_dir' field!
The last thing I did before switching off my computer was to change PHPIniDir (it resides in Apache's httpd, and is used to configure the path to php.ini).
I made it point to "C:/WINDOWS" because my php.ini file is inside my WINDOWS directory. I found it at the bottom of the httpd file.
Bookmarks