SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Catchable Fatal Error?

    I'm getting the following error but I can't seem to the find the issue:

    Catchable fatal error: Object of class DB could not be converted to string in catalog/category.inc on line 86

    There error is coming from this section of code

    function category($uid="") {
    global $tblPrefix;
    $this->table = $tblPrefix . $this->table;
    if($uid=="") { /* call with no uid, isNew*/
    $this->isNew=1;
    }
    else {
    /* lookup category on UID, if found OK else isNew */
    if($uid==0) {
    $this->name='TOP';
    return 1;
    }
    if($this->get_category_info($uid)) return 1;
    else {
    $this->isNew=1;
    return 0;
    }
    }
    return 1;
    }

    /* extracts information for this uid from database and populates our object */
    function get_category_info($uid) {
    $uid+=0; // Force numeric
    $db= new DB;
    if (!$db->query("Select * from $this->table where UID=$uid")) {
    $this->error = "Database Error: $db-Error";
    return 0;
    }

  2. #2
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $db-Error

    I think It has to be $db->Error
    My project: Open source Q&A
    (similar to StackOverflow)
    powered by php+MongoDB
    Source on github, collaborators welcome!

  3. #3
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think more issues are sprining from the following but I can't find an issue with that either:

    /* Include our item_view*/
    include($this->item_view_path[$this->item_view]);
    if($admin) {
    echo "
    <FORM action='#' method='GET'>
    <center><b>ITEM URL/b><input type='text' name='link' value='" .$config['insecureUrl'] . '/' . $config['listingsPage'] ."?item_id=$this->uid&action=" . ITEM_VIEW . "' size=50></center>
    </FORM>";
    }

  4. #4
    SitePoint Evangelist priti's Avatar
    Join Date
    Aug 2006
    Location
    India
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also came across with same error but mine is solved. It comes in following scenarios

    Consider In your class you have function name abc() and you are trying to access as follow
    $abc()

    so this results in Catchable Fatal Error .

    Regards.


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
  •