Wrox Programmer Forums
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 25th, 2003, 10:22 PM
Authorized User
Join Date: Oct 2003
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drill down

if i have a table that display the
1 sales for each category(ex cat1, cat2)
2. sales for each product that belongs to a particular category(prod1, prod2 for cat1 or prod3, prod4 for cat2)

   For the first table, i query all category and for the second table i query the the cat number selected by the user.
   How am i going to make the first table link to the second table if the user click the cat1 or cat2 on the first table. if click cat1, then display products for cat1 and if click cat2, display products for cat2

Old November 26th, 2003, 01:54 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

Well, this is pretty straight-forward.

If a user clicks on cat1, then you have that information in PHP from the $_GET array (assuming "click" means "click a link"). You know what category they clicked on, so you modify your product table's SELECT query to include a "WHERE category='{$_GET['category']}'" clause.

If the user has NOT clicked on anything, then there will be no $_GET['category'] variable set, so you display ALL the products for ALL categories.

Does that clear things up for you?

Take care,

Old November 28th, 2003, 09:46 PM
Authorized User
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks! i'll try and see how it works.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does the drill down goes? dash dev Crystal Reports 0 March 15th, 2008 12:50 AM
drill down-xml coolferrari XSLT 1 September 26th, 2007 12:50 PM
Drill-Through baaul BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 23rd, 2007 08:08 PM
Drill down issues aldwinenriquez Reporting Services 3 March 3rd, 2006 02:36 AM
how to drill down hosefo81 PHP How-To 0 November 21st, 2003 01:14 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.