473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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_category_subcategories($category_id) {
$child_category_query = db_query("select count(*) as count from categories where parent_id = '" . (int)$category_id . "'");
$child_category = db_fetch_array($child_category_query);

if ($child_category['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=true, $silent=false) {

global $DB_DIE_ON_FAIL, $DB_DEBUG;

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

if ($die_on_debug) die;
}

$qid = mysql_query($query);

if (! $qid && ! $silent) {
if ($DB_DEBUG) {
echo "<h2>Can't execute query</h2>";
echo "<pre>" . htmlspecialchars($query) . "</pre>";
echo "<p><b>MySQL Error</b>: ", mysql_error();
} else {
echo "<h2>Database error encountered</h2>";
}

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

return $qid;
}
in the bold line it is showing err
Sep 28 '06 #1
1 3274
ronverdonk
4,258 Expert 4TB
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:
Oct 2 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Troy Lynch | last post by:
I'm looking into writing a Category Hierarchy on a site I've written and am looking for some information about writing this kind of code. Maybe some samples or a book. Any information would be...
1
by: Ted | last post by:
I am currently putting together an eCommerce site. I have almost everything in place, but I am not happy with the category system for our products. There are around 2500 products in a SQL Sever...
2
by: shane-dated-1130371478.43db8f | last post by:
Hello all, I am working on a website for a bookstore and have run into a bit of a snag. I am trying to write a form where an admin can set the category for a book. However, categories can be of...
0
by: Paul Hendryx | last post by:
I have the table structure: CREATE TABLE . ( IDENTITY (1, 1) NOT NULL , NOT NULL , NULL , (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON GO
4
by: J-T | last post by:
Hello All, I have two objects one is Product and the otherone is the Category. Category object is like Food,books,Medicine and etc which has different tax rates . My product object has...
24
by: Phil Latio | last post by:
Let's say I have a simple web application running with just two MySQL tables. The tables structure is as follows: Table: category category_id (PK) category_name parent_category (FK)...
1
by: ollielaroo | last post by:
Hi guys, Firstly I did do a search for this one first but I couldn't find anything related in this forum. I am using Dreamweaver MX and trying to build admin pages for an ASP site. My problem is...
0
by: David Troxell - Encourager Software | last post by:
Product Scope 7 (http://www.encouragersoftware.com/) and Profile Exchanges enhanced with SetupCast publishing methods NOTE: If you are a software author, releasing commercial and/or shareware...
1
by: TomLasky | last post by:
Hi everyone, I'm creating a very powerful web store script in ASP. One of the things I am adding is to allow the user to create their own categories and sub categories for items they wish to sell....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.