Die()
ends the page. That's the whole point of that function :) You don't want to alter that functionality.
A method you cán do (note the end):
$query_area = mysql_query("SELECT * FROM tblcargos") or myCustomFunction();
myCustomFunction()
can handle the error any way you like. In fact, I'd strongly recommend doing that in favor of die()
.
You could make it so it shows a 'nice' error page, explaining the user what just happend.