Results 1 to 6 of 6

Thread: Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php on li

  1. #1
    Join Date
    Aug 2009
    Beans
    109

    Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php on li

    i am using ubuntu 9.10 with apache2, php5 and mysql.
    On opening this file in browser its showing the error
    PHP Code:
    <?php
    //phpinfo();
    $con=mysql_connect("localhost","root","sql");
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }
    ?>
    Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php on line 2
    How to rectify it..?

  2. #2
    Join Date
    Oct 2008
    Beans
    57
    Distro
    Ubuntu Karmic Koala (testing)

    Re: Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php o

    Quote Originally Posted by piyush.neo View Post
    i am using ubuntu 9.10 with apache2, php5 and mysql.
    On opening this file in browser its showing the error
    PHP Code:
    <?php
    //phpinfo();
    $con=mysql_connect("localhost","root","sql");
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }
    ?>
    Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php on line 2
    How to rectify it..?
    Are you sure to have php5-mysql package installed on your system?

  3. #3
    Join Date
    Aug 2009
    Beans
    109

    Re: Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php o

    Thanks a lot..i installed it and problem solved...

  4. #4
    Join Date
    Feb 2009
    Beans
    53

    Re: Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php o

    zoff_ita, I had the same problem and you solved it for me as well. Thank you!!

  5. #5
    Join Date
    Oct 2011
    Beans
    29

    Re: Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php o

    Thank you that solved my problem..

  6. #6
    Join Date
    Feb 2007
    Beans
    23,271
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Fatal error: Call to undefined function mysql_connect() in /var/www/welcome.php o


    From the Ubuntu Forums Code of Conduct.
    If a post is older than a year or so and hasn't had a new reply in that time, instead of replying to it, create a new thread. In the software world, a lot can change in a very short time, and doing things this way makes it more likely that you will find the best information. You may link to the original discussion in the new thread if you think it may be helpful.
    Thread closed.

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
  •