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 -> Tips & Solutions

 Listbox -2 level tree view with SQL only

Print topic Send  topic

Author Message
GeorgeS

Posts: 206
Posted: 09/19/2008, 8:53 PM

Can be used for simple 2 level menu or categories structure.
Fields:
cat_id, cat_name,cat_pid

-----------------------------------------------------------------------
SELECT e.cat_id, concat_ws(' - ',IF(m.cat_name IS not NULL,'',m.cat_name),e.cat_name) AS menu_tree,
concat_ws(' > ',m.cat_name,e.cat_name) AS result
FROM menu AS e
LEFT OUTER JOIN menu AS m
ON e.cat_pid =m.cat_id
ORDER BY result, m.cat_name;
-------------------------------------------------------------------------

will create a listbox:

ABOUT US
- Our goals
- Who we are
SERVICES
- Folding
- Mailing
- Printing


_________________
GeorgeS
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.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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