连接字符串未作为函数参数传递

I have a page (index.php) that imports connections using require_once. The problem is that when i pass the connection string using $connectobject1 variable as function argument, it works in some functions but does not in others on the same page.

Any specific thing that i'm missing which is resulting it to work in only some functions of the same page.

here is the code for index.php:

require_once '../connect/db_connect.php';

function check1 ($connectobject1,$Id)
{

    function code..
}

function check2 ($connectobject1,$User)
{

    function code..
}

strangely for check2 the $connectobject1 doesn't seem to work.