SitePoint Sponsor |
|
User Tag List
Results 1 to 14 of 14
Thread: Problem with jokelist.php
-
Nov 23, 2004, 20:27 #1
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem with jokelist.php
Hi,
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\.......
What should I do?
Oye
-
Nov 23, 2004, 21:11 #2
- Join Date
- Nov 2004
- Location
- tn
- Posts
- 60
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm guessing you'll be asked to post your code so the gurus can take a looksee :P
-
Nov 23, 2004, 21:17 #3
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm slowly working my way through this problem......
-
Nov 23, 2004, 21:56 #4
- Join Date
- Dec 2003
- Location
- Federal Way, Washington (USA)
- Posts
- 1,524
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
Showcase your music collection on the Web
-
Nov 23, 2004, 22:24 #5
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I tried that, but unfortunately, I get the same problem of:
Fatal error: Call to undefined function mysql_connect() in C:\Documents and Settings\.......
When I run phpinfo.php, I can't see any mention of mysql in the Configure Command field.
-
Nov 23, 2004, 22:46 #6
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What an annoying error! I've spent hours scouring different forums but none of the solutions mentioned seem to work!
-
Nov 23, 2004, 22:57 #7
You have to uncomment the mysql lines in your php.ini
-
Nov 23, 2004, 23:02 #8
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Do you mean extension=php_mysql.dll?
I removed the comment a while ago and it still doesn't work.
-
Nov 23, 2004, 23:05 #9
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's getting late (too late!!!) and I don't want to throw my computer across the room!
Catch you guys some other time....
-
Nov 24, 2004, 03:36 #10
- Join Date
- May 2004
- Location
- Cedar Rapids
- Posts
- 295
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Nov 24, 2004, 07:56 #11
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i've checked the PHP/ext folder (my folder's called php-5.0.1/ext) and php_mysql.dll does exist.
i've also copied both libmysql.dll and libmysqli.dll to the WINDOWS/system32 folder.
-
Nov 24, 2004, 08:11 #12
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It works!!!
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!
HOORAY!
-
Nov 24, 2004, 08:20 #13
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
e.g. PHPIniDir "C:/WINDOWS"
-
Nov 24, 2004, 08:20 #14
- Join Date
- Nov 2004
- Location
- London
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for all the suggestions!
Bookmarks