Product Category tree

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yogendramishra
    New Member
    • Sep 2006
    • 1

    #1

    Product Category tree

    Hello friends,
    i am creating a product catelog tree with multilevel hierarchi.I am using tree class and inside that i want to show the category tree. But it is showing errors to me. I have also created a dblib file to access sql quries. The error it is showing in this only. So i am unable to fetch data from database.Here is tree class fucntion where i m fetching data
    function tep_has_categor y_subcategories ($category_id) {
    $child_category _query = db_query("selec t count(*) as count from categories where parent_id = '" . (int)$category_ id . "'");
    $child_category = db_fetch_array( $child_category _query);

    if ($child_categor y['count'] > 0) {
    return true;
    } else {
    return false;
    }
    }
    and here is db_query code which is stored in dblib file and excatly error is here
    function db_query($query , $debug=false, $die_on_debug=t rue, $silent=false) {

    global $DB_DIE_ON_FAIL , $DB_DEBUG;

    if ($debug) {
    echo "<pre>" . htmlspecialchar s($query) . "</pre>";

    if ($die_on_debug) die;
    }

    $qid = mysql_query($qu ery);

    if (! $qid && ! $silent) {
    if ($DB_DEBUG) {
    echo "<h2>Can't execute query</h2>";
    echo "<pre>" . htmlspecialchar s($query) . "</pre>";
    echo "<p><b>MySQ L Error</b>: ", mysql_error();
    } else {
    echo "<h2>Databa se error encountered</h2>";
    }

    if ($DB_DIE_ON_FAI L) {
    echo "<p>This script cannot continue, terminating.";
    die();
    }
    }

    return $qid;
    }
    in the bold line it is showing err
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    The error it is showing in this only
    What error exactly is displayed and after what piece of code???
    And what is the content of $query in your mysql_query??

    Ronald :cool:

    Comment

    Working...