Results 1 to 6 of 6

Thread: [RESOLVED] mysql_connect issue

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Resolved [RESOLVED] mysql_connect issue

    When I try to connect to mysql using the mysql_connect function it gives me this error: "Call to undefined function mysql_connect()" I have already remove the semi-colon in line extension=php_mysql.dll in php.ini. What would be the other possible reasons behind this case?

    thanx a bunch for the help.

  2. #2
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: mysql_connect issue

    mar zim:

    It would sure be a lot easier to try and help you if you would post the code you are using to try and connect.

    I assume your mysqsl_connect() function is something like:

    mysql_connect('localhost', 'username', 'password'); If so, then, depending on your other code, it should work.

    Sounds like you just installed MySQL.

    Do you know if MySQL is running?

    Can you access it from the command line?

    Without seeing your code, I guess I don't have any more suggestions.

    Good Luck.

  3. #3

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: mysql_connect issue

    ok. I can connect using in the dos prompt.

    my code something like.
    PHP Code:
    <?php
    $link 
    mysql_connect('localhost','root','password');
    if(!
    $link){
    die(
    'Could not connect:'mysql_error());
    }
    echo 
    'Connected successfully';
    mysql_close($link);
    ?>
    edit: username=root;password=password;

  4. #4
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: mysql_connect issue

    Ok the error is that the specific function cannot be found, now have you checked to make sure that the extension path is correct?

    Code:
    ; Directory in which the loadable extensions (modules) reside.
    extension_dir = "ext"
    If the path is correct and the DLL is simpley not their then you can download it, as well as others from the PHP site, Collection of PECL modules for PHP 5.1.2

    Btw version of PHP are you using 4 or 5?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: mysql_connect issue

    Make a page that only contains

    <?php phpinfo(); ?>

    and see if mysql appears among the extensions.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: mysql_connect issue

    Thanks guys for all reply. I just uninstall PHP and install it again. Now it works maybe I just missed some configuration.

Posting Permissions

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



Click Here to Expand Forum to Full Width