CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 How to filter grid showing all n-level subs?

Print topic Send  topic

Author Message
Lizam
Posted: 01/24/2005, 9:21 PM

Let's say I have this category -> sub-category table:

id desc parent
1 Plan1 0
2 Plan2 0
3 Plan3 1
4 Plan4 1
5 Plan5 2
6 Plan6 2
7 Plan7 5
8 Plan8 5

I have details table:

id ...
1 ...
2 ...
3 ...
4 ...
5 ...
8 ...

On the search page, provide a listbox which only display the top category i.e. Plan1 and Plan2 and when selected filter the grid from the details table to show only the category and all its sub sub. For instance, if Plan 2 is selected, the result grid should show:

id ...
2 ...
5 ...
8 ...

Any ideas how to achieve this? Thanks for any input.

Best regards.
aakici


Posts: 49
Posted: 01/26/2005, 5:08 PM

You must execute a Sql statement indicates your dependings. Try a code like this.

global $YourFormName; //After this i write $YFN (indicates -> $YourFormName)
global $criter;
$criter = $YFN->YourListBoxName->GetValue();
if ($criter > 0) {
// Open connection
$db = new clsDBYourDataConnectionName();
$SQL = "SELECT id FROM details WHERE desc=".$criter;
$db->query($SQL);
$Result = $db->next_record();
if ($Result) {
$Sonuc = $db->f("id");
}
unset($db);
or you can do this :
click on the your grid. Then click .... next to you Data Connection property which is on the properties window. click on +. then select id from the field. then write listbox name in the parameter source.

good luck.
_________________
Regards,
M.Alpaslan AKICI
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.