#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,664
    Rep Power
    171

    Why doen't error_reporting(E_ALL) print errors on screen?


    Hello;

    I am consciously making a synthax error and missing a closing bracket ) at the end of the variable $arg. Why doesn't php show the error on screen and instead shows a blank page?
    PHP Code:
    ini_set('display_errors'1); 
    error_reporting(E_ALL);
    include 
    "/home/includes/connections.php";
    echo 
    $query "
    SELECT packages.id              AS PACKAGE_ID,
           annual_calendar.day_date AS DAY_DATE,
           allotments_new.day_date  AS ALLOTMENTS_DAY_DATE
    FROM   packages
           LEFT OUTER JOIN allotments_new
                        ON allotments_new.package_id = packages.id
           LEFT OUTER JOIN annual_calendar
                        ON annual_calendar.day_date = allotments_new.day_date
                           AND annual_calendar.day_date <=: next_year
    WHERE  packages.status = 'active'
    LIMIT  100  
    "
    ;

    $arg = array('next_year'=>date('Y-m-d'strtotime'+1 year')); 
    Thanks
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,071
    Rep Power
    9398
    Because that's a compile error. PHP compiles a file before executing it, so when it found the missing ) it hadn't executed any of your code. That's why development settings should not go in an ini_set() at runtime but rather something that's read earlier on, like a php.ini or php_value in the .htaccess.
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,664
    Rep Power
    171
    Originally Posted by requinix
    Because that's a compile error. PHP compiles a file before executing it, so when it found the missing ) it hadn't executed any of your code. That's why development settings should not go in an ini_set() at runtime but rather something that's read earlier on, like a php.ini or php_value in the .htaccess.
    Oh thanks : )

IMN logo majestic logo threadwatch logo seochat tools logo