使用修改的预订树横向显示类别/子类别 [英] displaying categories/subcategories using modified preorder tree transversal

查看:52
本文介绍了使用修改的预订树横向显示类别/子类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为自己的电子商务网站工作。我需要什么

一些帮助是当我试图显示不同产品的

类别/子类别时。

我决定使用修改的预订树横向算法。什么

我想在第一页上显示如下的catogories


书籍(35)

电子产品(23 )


括号内的数字是

类别中的产品数量。当点击书籍时,它会显示以下内容


书籍(35)

小说(18)

非虚构类(17 )

电子产品(23)


在我的MYSQL数据库表中,我有字段catid,name,lft和

rgt 。例如,对于上面提到的三个类别,我有

以下条目


catid name lft rgt

1 home 1 1

2本书2 17

4小说3 10

5小说11 16

3电子18 37
第一类家庭只是用来代表

整棵树的主根。如果有人能给我一些帮助,那将是非常值得赞赏的。提前谢谢。

解决方案

类别表应如下所示。它没有在第一条消息中显示




catid,name,lft,rgt

1,home,1 ,1

2,书籍,2,17

4,小说,3,10

5,非小说类,11,16
3,电子产品,18,37


hornedw写道:


我去过在我自己的电子商务网站上工作。我需要什么

一些帮助是当我试图显示不同产品的

类别/子类别时。

我决定使用修改的预订树横向算法。什么

我想在第一页上显示如下的catogories


书籍(35)

电子产品(23 )


括号内的数字是

类别中的产品数量。当点击书籍时,它会显示以下内容


书籍(35)

小说(18)

非虚构类(17 )

电子产品(23)


在我的MYSQL数据库表中,我有字段catid,name,lft和

rgt 。例如,对于上面提到的三个类别,我有

以下条目


catid name lft rgt

1 home 1 1

2本书2 17

4小说3 10

5小说11 16

3电子18 37

第一类家庭仅用于代表

整棵树的主根。如果有人能给我一些帮助,那将是非常值得赞赏的。先感谢您。


hornedw写道:


类别表应如下所示。它没有在第一条消息中显示




catid,name,lft,rgt

1,home,1 ,1

2,书籍,2,17

4,小说,3,10

5,非小说类,11,16
3,电子产品,18,37


hornedw写道:


>> ;我一直在为自己的电子商务网站工作。我需要什么帮助是当我试图显示不同产品的类别/子类别时。
我决定使用修改后的预订树横向算法。我想要的第一页是显示以下的目录

书籍(35)
电子(23)

里面的数字括号是该类别中的产品数量。当点击书籍时,它会显示以下内容

书籍(35)
小说(18)
非小说类(17)
电子产品(23)
在我的MYSQL数据库表中,我有字段catid,name,lft和
rgt。例如,对于上面提到的三个类别,我有以下条目

catid name lft rgt
1 home 1 1
2本书2 17
4小说3 10
5小说11 16
3电子18 37

第一类家庭只是用来代表整棵树的主根。如果有人能给我一些帮助,那将会非常感激。先感谢您。




我想我很困惑。你如何从小说链接或非小说或

书?


这样做对我来说看起来很混乱。

-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


Jerry


我试图设置它,当一个人点击书籍页面

将重新加载然后显示书籍,然后是非小说和小说

将出现在它下面。如下所示

书籍(35)

电子产品(23)


括号内的数字是该产品的数量

类别。当点击书籍时,它会显示以下内容

书籍(35)

小说(18)

非小说类(17)
电子产品(23)


它不一定必须间隔开。我可以使用项目符号列表

或类似的东西。我试图做的主要两件事是使用

修改的预订树算法并让它显示主要的
类别,然后显示主要类别及其子类别和

然后是页面上的其他类别。我正在讨论是否以这种方式做这件事,或类似于他们的类别在亚马逊网站上做的事情。


David

Jerry Stuckle写道:


hornedw写道:


类别表应如下所示。它没有在第一条消息中显示




catid,name,lft,rgt

1,home,1 ,1

2,书籍,2,17

4,小说,3,10

5,非小说类,11,16
3,电子产品,18,37


hornedw写道:


> I我一直在为自己的电子商务网站工作。我需要什么帮助是当我试图显示不同产品的类别/子类别时。
我决定使用修改后的预订树横向算法。我想要的第一页是显示以下的目录

书籍(35)
电子(23)

里面的数字括号是该类别中的产品数量。当点击书籍时,它会显示以下内容

书籍(35)

小说(18)

非小说类(17)电子产品(23)

在我的MYSQL数据库表中,我有字段catid,name,lft和
rgt。例如,对于上面提到的三个类别,我有以下条目

catid name lft rgt
1 home 1 1
2本书2 17
4小说3 10
5小说11 16
3电子18 37

第一类家庭只是用来代表整棵树的主根。如果有人能给我一些帮助,那将会非常感激。先感谢您。



我想我很困惑。你如何从小说链接或非小说或给b $ b bb书?


这样做对我来说看起来很混乱。


-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


I have been working on a ecommerce website for myself. What I needed
some assistance on was when i was trying to display the
categories/subcategories for the different products.
I decided to use the modified preorder tree transversal algorithm. What
I wanted was on the first page is to display the catogories as follows

Books (35)
Electronics(23)

The number inside the parenthesis being the number of products in that
category. When Books is clicked on, it would display the following

Books(35)
Fiction(18)
Nonfiction(17)
Electronics(23)

In my MYSQL database table, I have the fields catid, name, lft and
rgt. For example for the three categories mentioned above I have the
following entries

catid name lft rgt
1 home 1 1
2 books 2 17
4 fiction 3 10
5 nonfiction 11 16
3 electronics 18 37
The first category home was just used to represent the main root of the
whole tree. If anyone could give me some assistance, it would be much
appreciated. Thank you in advance.

解决方案

the category table should look like the following. it did not display
very well in the first message

catid, name,lft,rgt
1, home,1,1
2, books,2,17
4, fiction,3,10
5, nonfiction, 11,16
3, electronics,18, 37


hornedw wrote:

I have been working on a ecommerce website for myself. What I needed
some assistance on was when i was trying to display the
categories/subcategories for the different products.
I decided to use the modified preorder tree transversal algorithm. What
I wanted was on the first page is to display the catogories as follows

Books (35)
Electronics(23)

The number inside the parenthesis being the number of products in that
category. When Books is clicked on, it would display the following

Books(35)
Fiction(18)
Nonfiction(17)
Electronics(23)

In my MYSQL database table, I have the fields catid, name, lft and
rgt. For example for the three categories mentioned above I have the
following entries

catid name lft rgt
1 home 1 1
2 books 2 17
4 fiction 3 10
5 nonfiction 11 16
3 electronics 18 37
The first category home was just used to represent the main root of the
whole tree. If anyone could give me some assistance, it would be much
appreciated. Thank you in advance.


hornedw wrote:

the category table should look like the following. it did not display
very well in the first message

catid, name,lft,rgt
1, home,1,1
2, books,2,17
4, fiction,3,10
5, nonfiction, 11,16
3, electronics,18, 37


hornedw wrote:

>>I have been working on a ecommerce website for myself. What I needed
some assistance on was when i was trying to display the
categories/subcategories for the different products.
I decided to use the modified preorder tree transversal algorithm. What
I wanted was on the first page is to display the catogories as follows

Books (35)
Electronics(23)

The number inside the parenthesis being the number of products in that
category. When Books is clicked on, it would display the following

Books(35)
Fiction(18)
Nonfiction(17)
Electronics(23)

In my MYSQL database table, I have the fields catid, name, lft and
rgt. For example for the three categories mentioned above I have the
following entries

catid name lft rgt
1 home 1 1
2 books 2 17
4 fiction 3 10
5 nonfiction 11 16
3 electronics 18 37
The first category home was just used to represent the main root of the
whole tree. If anyone could give me some assistance, it would be much
appreciated. Thank you in advance.


I guess I''m confused. How do you link from "fiction" or "nonfiction" to
books?

This way of doing it looks quite confusing to me.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


Jerry

I was trying to set it up where when a person clicks on books the page
would reload and then display Books and then Nonfiction and Fiction
would appear under it. Like below
Books (35)
Electronics(23)

The number inside the parenthesis being the number of products in that
category. When Books is clicked on, it would display the following
Books(35)
Fiction(18)
Nonfiction(17)
Electronics(23)

It does not necessaryly have to be spaced over. I may use bulleted list
or something like that. The main two things I was trying to do was use
the modfied preorder tree algorithm and to have it display the main
category and then display the main category and its subcategories and
then the rest of the categories on the page. I was debating on whether
doing it this way or something similar to the way it is done at
Amazon.com on their categories.

David
Jerry Stuckle wrote:

hornedw wrote:

the category table should look like the following. it did not display
very well in the first message

catid, name,lft,rgt
1, home,1,1
2, books,2,17
4, fiction,3,10
5, nonfiction, 11,16
3, electronics,18, 37


hornedw wrote:

>I have been working on a ecommerce website for myself. What I needed
some assistance on was when i was trying to display the
categories/subcategories for the different products.
I decided to use the modified preorder tree transversal algorithm. What
I wanted was on the first page is to display the catogories as follows

Books (35)
Electronics(23)

The number inside the parenthesis being the number of products in that
category. When Books is clicked on, it would display the following

Books(35)
Fiction(18)
Nonfiction(17)
Electronics(23)

In my MYSQL database table, I have the fields catid, name, lft and
rgt. For example for the three categories mentioned above I have the
following entries

catid name lft rgt
1 home 1 1
2 books 2 17
4 fiction 3 10
5 nonfiction 11 16
3 electronics 18 37
The first category home was just used to represent the main root of the
whole tree. If anyone could give me some assistance, it would be much
appreciated. Thank you in advance.


I guess I''m confused. How do you link from "fiction" or "nonfiction" to
books?

This way of doing it looks quite confusing to me.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


这篇关于使用修改的预订树横向显示类别/子类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆