SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Hybrid View

  1. #1
    SitePoint Member
    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

  2. #2
    SitePoint Enthusiast
    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

  3. #3
    SitePoint Member
    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......

  4. #4
    $this->toCD-R(LP); vinyl-junkie's Avatar
    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

  5. #5
    SitePoint Member
    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.

  6. #6
    SitePoint Member
    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!

  7. #7
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to uncomment the mysql lines in your php.ini

  8. #8
    SitePoint Member
    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.

  9. #9
    SitePoint Member
    Join Date
    Nov 2004
    Location
    London
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry

    It's getting late (too late!!!) and I don't want to throw my computer across the room! Catch you guys some other time....

  10. #10
    SitePoint Addict psyon's Avatar
    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.

  11. #11
    SitePoint Member
    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.

  12. #12
    SitePoint Member
    Join Date
    Nov 2004
    Location
    London
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    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!

  13. #13
    SitePoint Member
    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"

  14. #14
    SitePoint Member
    Join Date
    Nov 2004
    Location
    London
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all the suggestions!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •