php-mysql problem

Discussion in 'PHP' started by danihel, Dec 21, 2005.

  1. #1
    hi
    I just decided to learn php and how to work with databases
    so i downloaded the latest version of apache php and mysql
    but whenever i use the mysql_connect() function the browser displays "Fatal error: Call to undefined function mysql_connect()".

    anyone could help my please?
     
    danihel, Dec 21, 2005 IP
  2. john_loch

    john_loch Rodent Slayer

    Messages:
    1,294
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    138
    #2
    Yes, you're missing the MySQL ext/module/libs for PHP.

    Cite the versions of each: Apache, MySQL, & PHP (and operating system), and I'll see if I can give you a little more help.

    Remember too, the latest and greatest is not always the wisest combination.

    Cheers,

    JL
     
    john_loch, Dec 21, 2005 IP
  3. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #3
    Have you used the function in a context like this ?

    And by the way :

    To see if you have installed MySQL correctly, make a page with just this on it:

    Also check that server Safe-mode is not enabled. If it's enabled, MySQL DB's won't work.
     
    Cristian Mezei, Dec 21, 2005 IP
  4. danihel

    danihel Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanx a lot for replies

    The versions are: mysql 5.0, apache http server 2.0.55, php 5.1.1,

    the code was:

    <?php
    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
    $connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
    echo "connection made";
    ?>

    the included file- config/db_config.php:

    <?php
    $db_host = "localhost";
    $db_user = "php";
    $db_password = "f00";
    ?>

    its from a tutorial and it did work for them
     
    danihel, Dec 21, 2005 IP
  5. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #5
    Now correlate these two :

    You said :

    I said :

    Get my point ? :)
     
    Cristian Mezei, Dec 21, 2005 IP
  6. danihel

    danihel Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    well i just cant find out how to get it working or where to get this extention
    my php folder contains some mysql libraries(msql.dll, libmysql.dll) and i included the folder in the system paths which was recommended on the php page but thats all the info i found about it
     
    danihel, Dec 21, 2005 IP
  7. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #7
    Cristian Mezei, Dec 21, 2005 IP
  8. forkqueue

    forkqueue Guest

    Messages:
    401
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Where the hell did you get that idea?
     
    forkqueue, Dec 22, 2005 IP
  9. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #9
    Instead of being a smartass, try to help the poor guy mate. Be the expert :)
     
    Cristian Mezei, Dec 22, 2005 IP
  10. danihel

    danihel Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    thanx a lot for the page refrence expertu now its finally working as its supposed to
     
    danihel, Dec 22, 2005 IP
  11. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #11
    Welcome :)
     
    Cristian Mezei, Dec 22, 2005 IP
  12. forkqueue

    forkqueue Guest

    Messages:
    401
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #12
    By giving him false information that you can't use MySQL and safe mode? I'd hardly call that helping..
     
    forkqueue, Dec 22, 2005 IP
  13. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #13
    Dude. Chill .. What the hell ? I was helping the guy out. I never said i am a PHP expert.

    As a matter of fact i know NOTHING of PHP, and i still helped the guy.

    Keep wankering yourself, or get a grip on your life. Help others. :)
     
    Cristian Mezei, Dec 22, 2005 IP