PHP Error

Discussion in 'Website Development & Design' started by Taz, May 14, 2013.

  1. Taz

    Taz
    uix_expand uix_collapse
    New Member

    Joined:
    Dec 20, 2010
    Messages:
    21
    Likes Received:
    0
    Hi, I'm trying to publish my website and i get this error.

    This is my db.php
    PHP:
    <?php
    define
    ('DB_HOST''localhost');
    define('DB_NAME''');
    define('DB_USERNAME''');
    define('DB_PASSWORD''');

    $odb = new PDO('mysql:host=' DB_HOST ';dbname=' DB_NAMEDB_USERNAMEDB_PASSWORD);
    ?>
    When I fill this in and try to login in or register, I get this error:

    Code:
    Fatal error: Call to a member function prepare() on a non-object in /home/thecozyz/public_html/eos/login.php on line 45
    Same with register:

    Code:
    Fatal error: Call to a member function prepare() on a non-object in /home/thecozyz/public_html/eos/register.php on line 45
    This is my login code: http://pastebin.com/NMNZpJ2r
    This is my register code: http://pastebin.com/U92jRAfL
    How do I fix this?
     
  2. anirban09P

    anirban09P
    uix_expand uix_collapse
    New Member

    Joined:
    Dec 19, 2013
    Messages:
    28
    Likes Received:
    0
    PHP Error is the process of catching errors raised by your program and then taking appropriate action. If you would handle errors properly then it may lead to many unforeseen consequences.
     
  3. andrewc

    andrewc
    uix_expand uix_collapse
    Member

    Joined:
    Nov 12, 2013
    Messages:
    175
    Likes Received:
    21

Share This Page