SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2012
    Posts
    49
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Exclamation 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
    PHP Code:
    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

    PHP Code:
    <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 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

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which line is pointed as the error line? I can see no prepare() call.
    http://www.yourshoutbox.com <- FREE chat for your website - limited offer
    http://www.smartchatbox.com <- let your visitors talk

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2012
    Posts
    49
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    thank you guy i found the solution thank for no 1 reply


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •