tags:

views:

74

answers:

1

Hi , I Connent and Query My Db Using PEAR DB Like This :

if(stristr($_SERVER['HTTP_HOST']  , 'localhost')){
$dsn = 'mysql://root:@localhost/xxx' ;
}else{
$dsn = 'mysql://xxx:xxx@localhost/xxx' ;
}
$dbc =& DB::connect($dsn);
$dbc->query("set names utf8" );
if (PEAR::isError($dbc , array('debug'=>3))) {
    die($dbc->getMessage());
}

in Some Hosting It's Working Perfectly And for example if DB user doesn't have sufficient permissions it's sayes : Insufficient Permission , and other errors So Forth . and when i fix the problem the site will comes up and running well .

but in many hosting it's dosen't show many error !! and nothing on the page also ! the page is completly blank , no errors , no notice nothing ! i'm also set error_reporting(E_ALL) in top of my script . so i can't find the bug anyway is there any solution for such problem .

A: 

Make sure display_errors is on (or check the logs):

ini_set('display_errors', true);
Greg
@Greg i check Both and set display_errors true but still nothing ! No errors and nothing in log file
mehdi
@Greg var_dump($dbc); still nothing shown !
mehdi
That's interesting... A white page is usually a symptom of running out of memory, or sometimes bad encoding. I'd recommend checking your error logs
Greg
A white page is a symptom of any unreported error, not just encoding or memory issues.
Mike B
@Mike B Yes, a segfault can also cause a white page, and probably others but in my experience it's usually memory - anything else will be displayed
Greg