#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    Hello,

    I would like to be taught about how can I manage this:

    1.- I have two mysql tables (Products and Categories).
    2.- Tipical 'Products' entries are:

    ID - P_NAME - P_Category_ID - P_DESCRIPTION
    1 - Mouse - 1 - Microsoft mouse..
    2 - Canon BJ-200 - 2 - Canon BJ-200 Buble Printer.
    3.- Helwet-Packard - 2 - Last HP printer..
    4.- Quick-Cam - 3 - Color USB Quick-Cam
    ...

    3.- Tipical 'Categories' entries are:

    ID - C_NAME - DESCRIPTION
    1 - Mouses - List of mouses.
    2 - Printers - List of printers.
    3 - Cams - List of cams
    ...

    3.- now I would like to search products and display them grouping by categories. I do know how to make a search and how to order results but I don't know how to grouping these records by categories. For instance:

    Top > Mouses
    1. Mouse: Microsoft mouse

    Top > Printers
    2. Canon BJ-200: Canon BJ-200 Buble Printer.
    3. Helwet-Packard: Last HP printer..

    Top > Cams
    4. Quick-Cam: Color USB Quick-Cam

    Sorry for my poor writing english and thanks in advance.

    Toni


  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    5
    Rep Power
    0
    Check out the 3 part tutorial about setting up a e-commerce site on www.devshed.com, it should help you with this problem.

    Go to http://www.devshed.com/Server_Side/PHP/ and you will see all three. Excellent tutorial and download the code, it is organized well and easy to follow. Pay close attenction to how the products and categories are set up.

Similar Threads

  1. Replies: 4
    Last Post: February 9th, 2004, 12:07 AM
  2. display data from two tables using drop down box
    By skootz in forum PHP Development
    Replies: 9
    Last Post: January 23rd, 2004, 09:55 AM
  3. Joining data across multiple tables
    By getting_there in forum MySQL Help
    Replies: 8
    Last Post: January 13th, 2004, 09:51 AM
  4. my comp sux lately , need help from pro's
    By Hykinsel007 in forum Windows Help
    Replies: 2
    Last Post: January 5th, 2004, 02:52 PM
  5. adding data to 2 tables at the same time
    By bulletz in forum ASP Programming
    Replies: 1
    Last Post: December 29th, 2003, 01:13 AM

IMN logo majestic logo threadwatch logo seochat tools logo