Fatal error: Call to a member function prepare() on a non-object in

Dear all
i have problem with my code 5days ago have no solution any people please help me
menu.php (this is dynamic menu i want to create but it have problem)
it fatal error:
Fatal error: Call to a member function prepare() on a non-object in
i think in my connection class have destruct that why i prepare() on a non-object but now i need a solution because i want it dynamic like joomila


require("contr/conect_class.php");
require("contr/select_class.php");
require("fnc/fnc_select.php");
$statement = fnc_select("sevices");
    while ($row = $statement->fetch(PDO::FETCH_ASSOC)){
    echo
    '<li><a href="test.php?test_kh='.$row['test_kh'].'">'.$row['test_kh'].'</a></li>';
    }

menuset.php


<div id="menu">
<div id="menuset">
    <ul>
        <li><a href="index.php">Home</a></li>
<?php
    require("template/menu.php");
?>
    </ul>

</div>
</div>
</div>

when i require it to

test.php
PHP Code:


<?php
require("template/headerset.php");
require("template/menuset.php");
require("template/bodyleft.php");
require("fnc_phcontr/fnc_select_edit.php");
$comlang = $_GET['test_kh'];
$returnstate = fnc_select_edit("servicedet", "ostg_lang", "'".$comlang."'");
$row = $returnstate->fetch(PDO::FETCH_ASSOC);
echo $row['test_detail'];
require("template/bodyright.php");
require("template/footerset.php");

?>

please help me

Which line is pointed as the error line? I can see no prepare() call.

thank you guy i found the solution thank for no 1 reply