PHP怎么获取一个分类下面的所有子分类的数据?



  • 数据表结构如下:
    | category | CREATE TABLE category (
    id int(11) NOT NULL DEFAULT '0',
    pid int(11) DEFAULT NULL,
    title varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
    name varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
    PRIMARY KEY (id)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

    问题:

    现在每一个分类都可以是无限级,随便点击一个全部,展现所有当前分类下面的子分类数据。
    比如:点击了食品分类
    逻辑:食品中有水果,蔬菜,水果里有苹果,香蕉,蔬菜里有西蓝花,白菜,等等。
    点击食品后,怎么把苹果,香蕉,西蓝花,白菜的所有数据展现出来?

    也就是说,不管点击哪个分类,都把当前分类下面的所有子分类下面的数据都返回。

    请问怎么搞呢?(PHP)


Log in to reply
 

最新帖子

最新内容

  • S

    You have more great sources & sdk for business card scan for mobiles here: http://www.card-reader.com/mobile_scanning_solutions.htm

    read more
  • S

    Since exec seems to be the constant, I would iterate through the excel and create a dictionary with the exec as the key and another dictionary as a value. Inside that dictionary I would define each category.

    ex.

    <pre class="lang-py prettyprint-override">``` dictionary = {John Smith:{Bus:123,Fax:sdfas,Res:adsf}, Adam Smith:{Bus:123,Fax:sdfas,Res:adsf}} Then you simply write something to take data from the dictionary and put it in excel in your chosen format.

    read more
  • S

    Tools Information:

    ABBYY Mobile OCR Engine:(Paid)

    ABBYY Mobile OCR Engine is a powerful software development kit which allows developers of mobile and small footprint applications to integrate highly accurate optical character recognition (OCR) technologies that convert images and photographs into manageable and searchable text. Toolkit supports the most popular mobile platforms and devices - iOS (iPhone) and Android.

    ABBYY Mobile OCR Engine

    Demo App in play store: https://play.google.com/store/apps/details?id=com.abbyy.mobile.bcr&hl=en

    Tesseract OCR Engine (mainly maintained by Google):(Free)

    It's used android tesseract tools and is very easy to use.Android application to extract the text from the image being captured by the camera of your Android phone! They are using a fork of Tesseract Android Tools by Robert This called Tess Two. They are based on the Tesseract OCR Engine and Leptonica image processing libraries.

    Demo App in Play store: https://play.google.com/store/apps/details?id=com.datumdroid.app

    Library available in GitHub: https://github.com/rmtheis/tess-two

    OCR Library configure in Eclipse: http://www.luigimarino.altervista.org/blog/informatica/13-configureandroidlibrary

    OcrApiService : Ocrapiservice.com provides an online and cloud based OCR (Optical Character Recognition) REST API

    OcrApiService

    Demo : https://github.com/smart-mobile-software/ocrapiservice

    read more
  • S

    Closed. This question is off-topic. It is not currently accepting answers. Learn more.

    Want to improve this question? Update the question so it's on-topic for Stack Overflow.

    Closed 2 years ago.

    Is there any library for business card scanner.I am new to android. Help me out. Thanks in advance.

    read more
  • S

    I am trying to parse data from excel into a new table to tidy up the data.

    I have already tried to parse them manually but there is too many data

    This is the original data from excel

    https://imgur.com/a/I1mraVr

    I am trying to get this

    https://imgur.com/a/GsdRu9u

    read more

推荐阅读