Use of undefined constant dbLink

Discussion in 'PHP' started by aden, Apr 14, 2008.

  1. #1
    Hi there,

    I haven't done any updates to my website: www.tickity-boo.co.uk, however today the site 's coming up with lots of errors. My host says it's not their end and that I need to look into constants in my php script. Not that familiar with php, so any help would be much appreciated.
     
    aden, Apr 14, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    put:

    
    <?php
    error_reporting(E_ALL ^ E_NOTICE);
    ?>
    
    PHP:
    at the top of the problematic file.

    Edit: This is generally caused by using things like $array_of_names[name] as opposed to $array_of_names['name']

    Jay
     
    jayshah, Apr 14, 2008 IP
  3. aden

    aden Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Jay,

    Many, many thanks, everything's fine now. Just quickly, what does this code do and why did the website all of a sudden not function without it :
    <?php
    error_reporting(E_ALL ^ E_NOTICE);
    ?>
     
    aden, Apr 14, 2008 IP
  4. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Hello,

    Basically, the code tell's PHP to display all errors, except "notices". Arguably, they aren't errors at all and most hosts should have the code I provided you set in the PHP.ini file anyway.

    Jay
     
    jayshah, Apr 14, 2008 IP
  5. aden

    aden Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Cheers, Jay, many thanks again :)
     
    aden, Apr 14, 2008 IP