I've read carefully the reply to this question How does “do something OR DIE()” work in PHP? but yet I can not use the OR DIE()
properly into my script using oop like in the following snippet of code
class UsingMysql {
...
function QueryDB ($query_string) {
$resource = mysql_query ($query_string);
return $resource;
}
}
...
$mysql = new UsingMysql();
...
function get_director() {
global $mysql;
$query_d = ...
$result_d = $mysql->QueryDB($query_d) or die (mysql_error());
}
...
get_director();
My script works fine only when I remove the OR DIE
construct from the statement. Why?