#1
  1. No Profile Picture
    Ulrik N
    Guest
    Devshed Newbie (0 - 499 posts)
    I have just installed MySql and php3 on my RedHat6.0, and everything seems ok… But this is the error message I get.
    I think it must be a configuration problem, but I fail to see where..

    Fatal error: Call to unsupported or undefined function mysql_connect() in /home/httpd/html/test.php3 on line 11

    Here is the script:

    <?php

    mysql_connect("localhost", "webuser", "");
    $query = "SELECT name, phone FROM mytable";
    $result = mysql_db_query("example", $query);

    if($result) {
    echo "Found these in the db:<ul>";
    while ($r = mysql_fetch_array($result)) {
    $name = $r["name"];
    $phone = $r["phone"];
    echo "<li>$name, $phone";
    }
    echo "</ul>";
    } else { echo "No data found!"; }
    mysql_free_result($result);

    ?>


    ------------------
    -ulrik-
  2. #2
  3. No Profile Picture
    Ulf Wendel
    Guest
    Devshed Newbie (0 - 499 posts)
    Ulrik,
    have you compiled php with mysql support? Check it with phpinfo() and if there's nothing about mysql go for a customized php interpreter.

    Ulf
  4. #3
  5. No Profile Picture
    Ulrik N
    Guest
    Devshed Newbie (0 - 499 posts)
    Err..
    No MySql was mentioned in the phpinfo(). So I guess I don’t have any support for it.
    But what is it that you say that I need?(customized php interpreter)? And where do I get It?


    ------------------
    -ulrik-
  6. #4
  7. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    MySQL support is included in the PHP package, but you have to specify that it be compiled in. (during PHP 'configure' stage: ./configure --with-apache=/path/to/apache --with-mysql=/path/to/mysql).

    If you're using binary RPMs, you should probably uninstall those and do a fresh install of PHP/Apache straight from the source tarballs (downloaded from respective websites).
  8. #5
  9. No Profile Picture
    Gianni
    Guest
    Devshed Newbie (0 - 499 posts)
    hello there
    I have the same proble, but I'm running php,mysql and apache on an NT machine

    any ideas ?
  10. #6
  11. No Profile Picture
    rycamor
    Guest
    Devshed Newbie (0 - 499 posts)
    Ulrik,

    I recognize the script you are trying to run. You probably got it at:

    http://www.sfu.ca/~yzhang/linux/webdb/

    If you follow carefully all of Ying Zhang's instructions about compiling Apache, PHP, and MySQL, it works every time. Give it a try, but be careful not to miss a step.
  12. #7
  13. No Profile Picture
    Ulrik N
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi there!

    Thanks for all your reply's..
    I got it running now.

    regards

    ------------------
    -ulrik-

Similar Threads

  1. MySQL password problems NOT root
    By braveheart in forum MySQL Help
    Replies: 2
    Last Post: February 15th, 2004, 09:18 AM
  2. Replies: 1
    Last Post: January 30th, 2004, 07:04 PM
  3. problems with unicode (UTF8) and MySQL 4.1
    By xdummy in forum MySQL Help
    Replies: 0
    Last Post: January 28th, 2004, 05:21 AM
  4. MySQL Control Center connection problems
    By FragMaster B in forum MySQL Help
    Replies: 3
    Last Post: January 19th, 2004, 10:44 AM

IMN logo majestic logo threadwatch logo seochat tools logo