because variables declared outside functions aren't accessable unless you pass them in as arguments or use the global keyword inside the function with the variable you want to import.
functions are separate from the rest of your script, meaning you could have a global variable with the name $var and a local variable in a function called $var but they will be two different variables.
while a function is executing the variables declared inside, are only in existance while the function is executing. as soon as the function reaches the return statement or reaches the end of the block, all variables inside are destroyed.
for full explanation on variable scope
see http://php.net/variables.scope
if you want $db_table to be available inside the function, you can do this:
function check_pass($user_name,$pass)
{
global $db_table; //bring $db_table into this function scope
//...rest of code
}