Php Use External Variable In Function Sql