Fatal Error: Call to undefined function: ()

Discussion in 'PHP' started by timallard, Feb 3, 2008.

  1. #1
    Hello,

    Im trying to connect to my database from php.
    I have my file db.php as my connection file.

    <?php
    $host = '';
    $username = '';
    $password = '';
    $database = '';

    $connection = mysql_pconnect($host, $username, $password);

    $mysql_select_db($database, $connection);
    ?>

    but it is returning a fatal error. I can not figure out why..I have the respected data within the ''.

    Any suggestions or help would be greatly appreciated.

    Thank you,
    -Tim
     
    timallard, Feb 3, 2008 IP
  2. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #2
    $mysql_select_db($database, $connection);

    should be:

    mysql_select_db($database, $connection);
     
    SoKickIt, Feb 3, 2008 IP
    timallard likes this.
  3. timallard

    timallard Well-Known Member

    Messages:
    1,634
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    158
    #3
    ah ha! pesky things that get overlooked. +1

    Thank you.
    -Tim
     
    timallard, Feb 3, 2008 IP
  4. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Tell me about it... :D
     
    SoKickIt, Feb 3, 2008 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    If you use a decent syntax-highlighter, this won't happen that easily.
     
    nico_swd, Feb 4, 2008 IP