SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2004
    Location
    Montreal
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Call to undefined function mysql_connect()

    Hi everyone

    I'm having a weird problem, I have installed Apache 2.0.52, PHP 5.0.3 and MySQL 4.1.8 on XP SP1. After struggling and searching over the web to find a way to make MySQL working (had to copy both 'php_mysql.dll' and 'libmysql.dll' in 'C:/Windows/System32'), I finally had it half way working. Meaning, I'm using an application called 'PHP Expert Editor' to program. I created a script that allows me get some data from the database. The application returns the right info HOWEVER when I open up the same script but this time from Explorer I get the following error :

    Fatal error: Call to undefined function mysql_connect() in D:\To_backUp\burnit\Webserver\MYSQL_tables\mail.php on line 13

    Line 13 is a basic mysql connect, here the line

    $db_connect = mysql_connect($localhost, $userlog, $password);

    Question #1
    How come it works on 'PHP Expert Editor' and not on Internet Explorer?

    Question #2
    Also when I do this function 'phpinfo();', I don't see anywhere that mysql is enable?

    Thanks
    Badaboom
    Last edited by Badaboom; Dec 16, 2004 at 15:40.

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean this application? The website mentions it comes with its own webserver. Does it utilise the same PHP installation as your Apache does? As you mentioned you already copied the libriaries over, I suppose you already know that PHP 5 doesnt come with automatic MySQL support. Did you also activate the respective extension entry in php.ini?

    But as you are using MySQL 4.1 you might want to consider to use the new MySQLi extension.

  3. #3
    SitePoint Member
    Join Date
    Dec 2004
    Location
    Montreal
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi I finally found my problem. I had to specify in httpd.conf where was my php.ini file with this line PHPIniDir "C:/PHP". Now I can see that MySQL is enabled in phpinfo(). Everything is working properly.

    To answer your question:
    Yeah! Indead it's the same application and your right it's independent from my apache server. However php, and MySQL needs to be installed and running. The only difference is that the application uses the 'PHP.exe' while Apache uses the 'php5apache2.dll'.

    Thanks


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
  •