db connection problem

Discussion in 'PHP' started by demons-halo, Sep 22, 2009.

  1. #1
    Im installing a script on my site and i keep getting this error



    this is the files i have to edit, ive tried to edit it loads of times and i just dont know what im doing, what do i have to edit in here...??

     
    demons-halo, Sep 22, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    After you instantiate that class you simply have to call the configure method with the required parameters:

    $db->configure($host, $user, $pass, $database);
    PHP:
    (I am assuming your class instance is called $db and your parameters are already defined)

    And if you don't want to do that then just edit the class variables..

    
    var $host = 'localhost';
    var $user = 'username';
    var $password = 'bla';
    var $database = 'dsds';
    
    PHP:
    but that's not recommende.
     
    premiumscripts, Sep 22, 2009 IP
  3. demons-halo

    demons-halo Active Member

    Messages:
    243
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    im still recieving this...

    what does it mean??
     
    demons-halo, Sep 22, 2009 IP
  4. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Exactly what it says, you haven't supplied the password.. or typed an incorrect one.
     
    premiumscripts, Sep 22, 2009 IP
  5. demons-halo

    demons-halo Active Member

    Messages:
    243
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #5
    lol it was all down to a silly typo!!!!

    thank you very much for your help

    dH
     
    demons-halo, Sep 22, 2009 IP
  6. Martinoes

    Martinoes Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    $db = new database();
    $db->configure("HOST", "USERNAME", "PASSWORD", "DATABASE NAME");

    $db->connect();

    if you want formatted code, click here: http://shortwebsite.com/f11469
     
    Martinoes, Sep 24, 2009 IP
  7. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #7
    demons-halo is programming his whole site with freebie code in the last 5 hours on DP .
     
    ezprint2008, Sep 25, 2009 IP