if(!(@mysql_connect("$host","$user","$pass") && @mysql_select_db("$tablename")))
That is telling you that either it is not connecting to the database or it cannot select the database.
Since the author disabled warnings from the two functions, you cannot tell which one is the problem.
But...