this one is so simple i must be missing something obvious. basically i've got a three stage error thing going on with my DB connection here....
"$STRdbnoconnect " should be returned if there's a prob connecting to the db...
"$STRtablenoselect" if the appropriate table can't be selected...
"$STRdbnoretrieve" if nothing can be retrieved from the db [ie. if it's empty]
[the "errorbox( )" function just formats the error string nicely.]
still with me?... OK if i run the page with the DB empty i get the 2nd [ie. couldn't select table] error returned rather than the 3rd [couldn't get any info from DB] error. however if i remove the 2nd "die(errorbox("$STRtablenoselect")" and replace it with a plain ol' "die" command the connection correctly falls through to the 3rd [couldn't get any info from DB] error.
so why does having a "die(& do some stuff)" not work but a die( ); does?
scource:
@mysql_connect($dbhost, $dbuser, $dbpassword)
or die(errorbox("$STRdbnoconnect"));
@mysql_select_db($dbtablename)
or die(errorbox("$STRtablenoselect"));
//////////////////// database query ////////////
@$query = "select ....... from $dbtablename order by ......";
@$result = mysql_query($query);
@$number = mysql_numrows($result);
////////////////// get no. of results ///////////
if ($number == 0)
{
die(errorbox("$STRdbnoretrieve"));
}
elseif ($number > 0).......