CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 help - multiple categories in one form

Print topic Send  topic

Author Message
Michael A. Weaver
Posted: 07/06/2001, 11:46 AM

This may have been answered before, but I can't seem to find it in the
newsgroup. Using PHP4, MySQL, Apache, CC 1.1.16 ...

I'm trying to display recent news headlines in one form. The news is
populated by a MySQL db. The news can be one of three types, as determined
by the administrator in the "type" column. I need the output to display:

Type1
Type1_News_Headline #1
Type1_News_Headline #2
Type2
Type2_News_Headline #1
Type2_News_Headline #2
Type3
Type3_News_Headline #1
Type3_News_Headline #2

Each headline links to the full story.

I can do it by creating a seperate form for each, using SQL like this:

SELECT id_news,title,date FROM news Where type='General' ORDER BY date LIMIT
2

Is there a better way to take care of all three types in one SQL statement?
Thanks for the help.

michael



Scott R. Senay
Posted: 07/07/2001, 10:03 AM

Nope, you are on the right track with this... Regardless of what exactly
you use to get there, you will have to have several SQL statements execut to
get this done. I have not used it, but CC has a "tree" page in the page
wizard, though from the general looks of it I don't know that it will do
this for you. Possibly the simplest thing you can do would be to place
three or so subforms on the page and have each subform grab it's own
records...

Scott...

"Michael A. Weaver" <michael@tminuszero.com> wrote in message
news:9i511b$hqd$1@news.codecharge.com...
> This may have been answered before, but I can't seem to find it in the
> newsgroup. Using PHP4, MySQL, Apache, CC 1.1.16 ...
>
> I'm trying to display recent news headlines in one form. The news is
> populated by a MySQL db. The news can be one of three types, as determined
> by the administrator in the "type" column. I need the output to display:
>
> Type1
> Type1_News_Headline #1
> Type1_News_Headline #2
> Type2
> Type2_News_Headline #1
> Type2_News_Headline #2
> Type3
> Type3_News_Headline #1
> Type3_News_Headline #2
>
> Each headline links to the full story.
>
> I can do it by creating a seperate form for each, using SQL like this:
>
> SELECT id_news,title,date FROM news Where type='General' ORDER BY date
LIMIT
> 2
>
> Is there a better way to take care of all three types in one SQL
statement?
> Thanks for the help.
>
> michael
>
>
>
>

Jeff Stuart
Posted: 07/07/2001, 12:21 PM

Mike, I'm doing the same thing that you're doing. What I ended up doing was
taking the code from the 2 "detail" pages and kinda combing them into one
page. IE I had an order grid page and a separate items grid page. I took
the code from both and walla I had an expanded tree view. :)

--
Jeff Stuart
jstuart@neo.rr.com


"Scott R. Senay" <drsenay@conceptech.com> wrote in message
news:9i7fcc$v55$1@news.codecharge.com...
> Nope, you are on the right track with this... Regardless of what exactly
> you use to get there, you will have to have several SQL statements execut
to
> get this done. I have not used it, but CC has a "tree" page in the page
> wizard, though from the general looks of it I don't know that it will do
> this for you. Possibly the simplest thing you can do would be to place
> three or so subforms on the page and have each subform grab it's own
> records...
>
> Scott...
>
> "Michael A. Weaver" <michael@tminuszero.com> wrote in message
>news:9i511b$hqd$1@news.codecharge.com...
> > This may have been answered before, but I can't seem to find it in the
> > newsgroup. Using PHP4, MySQL, Apache, CC 1.1.16 ...
> >
> > I'm trying to display recent news headlines in one form. The news is
> > populated by a MySQL db. The news can be one of three types, as
determined
> > by the administrator in the "type" column. I need the output to display:
> >
> > Type1
> > Type1_News_Headline #1
> > Type1_News_Headline #2
> > Type2
> > Type2_News_Headline #1
> > Type2_News_Headline #2
> > Type3
> > Type3_News_Headline #1
> > Type3_News_Headline #2
> >
> > Each headline links to the full story.
> >
> > I can do it by creating a seperate form for each, using SQL like this:
> >
> > SELECT id_news,title,date FROM news Where type='General' ORDER BY date
> LIMIT
> > 2
> >
> > Is there a better way to take care of all three types in one SQL
> statement?
> > Thanks for the help.
> >
> > michael
> >
> >
> >
> >
>
>


   


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.