SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Dec 2000
    Location
    Turkey
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP3 cannot connect to mySQL (important)

    Hi there,

    I installed mysql to my dedicated server. I am able to use mysql database engine through the telnet session without any problems at all, however when I try to connect to mysql through PHP using the code below, I get the following error message

    "Fatal error: Call to unsupported or undefined function mysql_connect() in /the_full_path_to_the_file/veri_tabani2.php on line 3"

    The php code

    <?php

    $db = mysql_connect("ip_number",
    "user_name", "password");
    if (!$db) {
    echo( "<P>Unable to connect to the " .
    "database server at this time.</P>" );
    exit();
    }
    ?>

    PHP3 is installed on my Linux server

    Any help is greatly appreciated. I visited tens of support forums. I've seen this exact problem mentioned by many people but there is not a clear answer. The impression I've got is that I need to install a mysql connection module but I have no idea where to find it and how to install it.

    By the way, a couple lines from the php3.ini file of my server might be helpful for a quicker and more useful response.

    And the last word, sorry for indicating this problem as important. I know any problem left here is important for the person who left the question but the reason why I mentioned this problem as important is the fact that there are many people asking this same question but not getting an answer. Thanks a lot for the replies in advance.

    <Edited by Özgen Polat on 12-12-2000 at 10:18 AM>

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to compile PHP with MySQL support in to it, --with-mysql=/path/to/mysql is the option.

    But while you are at it you would be better off upgrading to PHP4 seen as you would have to compile PHP3 anyway, PHP4 is much faster (especially if you use the Zend Optimizer as well) and is well worth upgrading to.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.


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
  •