iwearnosox, let me break your error down for you
mysql_query() throws an error because $result = mysql_query($sql_result); this can not be run because $sql_result = "SHOW TABLE STATUS FROM " .$tdb; and the $tdb variable MUST contain your database name which is in mysql_select_db($tdb, $db); so the connection is broken, because the $tdb variable is incorrect.
As I've already stated in my previous comments from this thread [
1][
2] that error is specifically caused because the connection to the database was prevented either in
mysql_connect() or
mysql_select_db() and using
mysql_error() will specifically output the error causing the problem.