exist a way to avoid an object creation on error??
i have this on php5.0.5
public function __construct(){
@list($this->DSN,
$this->DBuser,
$this->DBpass) = func_get_args() ;
$this->res =
odbc_connect($t his->DSN,$this->DBuser,$this->DBpas$
if(!is_resource ($this->res)){
echo odbc_error()."< br>\n".odbc_err ormsg();
/// here put something to avoid contruction of the
object
}
}
in the script i have this:
$db = new DbCon('dsn','us er','pass');
if(is_object($d b)){
//do some
}else{
//do some
}
i have this on php5.0.5
public function __construct(){
@list($this->DSN,
$this->DBuser,
$this->DBpass) = func_get_args() ;
$this->res =
odbc_connect($t his->DSN,$this->DBuser,$this->DBpas$
if(!is_resource ($this->res)){
echo odbc_error()."< br>\n".odbc_err ormsg();
/// here put something to avoid contruction of the
object
}
}
in the script i have this:
$db = new DbCon('dsn','us er','pass');
if(is_object($d b)){
//do some
}else{
//do some
}
Comment