I really don\'t understand what the issue is here, I\'ve tried everything I can do diagnose the problem, and managed to isolate where I think the issue is being caused (see
I think the problem is in this line:
$size = mysql_num_rows($result) or die(mysql_error());
when the num_rows call returns 0, the interpreter will parse the die(mysql_error()) part even if there is no error at all.
Lesson: It's best to avoid ... or die() constructs. Do a proper check instead:
$size = mysql_num_rows($result);
if ($size === false) die(mysql_error()); // or, even better, trigger_error()
// so mySQL errors aren't shown
// in production