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
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
Comment