Welcome to Dream.In.Code
Getting Help is Easy!

Join 119,729 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,334 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



how do i write a cfif tag to prevent multiple DB field display

 
Reply to this topicStart new topic

how do i write a cfif tag to prevent multiple DB field display

cumupkid
post 19 Mar, 2008 - 07:46 AM
Post #1


New D.I.C Head

*
Joined: 22 Jan, 2008
Posts: 9

Im trying to mak this list only show each type of database field once.

EX. database has feild of GALLERY and there can be several records with gallery 4, this list is to show gallery 4 but only once.

I think i need some kind of cfif tag but not sure how to write it.

Here is the code

<cfparam name="FORM.GALLERY" default="1">
<link href="../assets/styles.css" rel="stylesheet" type="text/css">
<cfquery name="qGallery" datasource="seanBerrodin">
SELECT GALLERY
FROM art
ORDER BY GALLERY ASC
</cfquery>

<cfoutput query="qGallery">

<table border="0" cellpadding="0" cellspacing="0" id="galleryNavbar">
<tr>
<td><a href="gallery.cfm?gallery=#qGallery.GALLERY#">#qGallery.GALLERY#</a></td>
</tr>
</table>
</cfoutput>
<p>&nbsp;</p>
User is offlineProfile CardPM

Go to the top of the page


sansclue
post 19 Mar, 2008 - 08:41 AM
Post #2


D.I.C Head

**
Joined: 21 Nov, 2007
Posts: 92



Thanked 4 times
My Contributions


Use SELECT DISTINCT in your query to eliminate the duplicates.

User is offlineProfile CardPM

Go to the top of the page

cumupkid
post 19 Mar, 2008 - 12:03 PM
Post #3


New D.I.C Head

*
Joined: 22 Jan, 2008
Posts: 9

QUOTE(sansclue @ 19 Mar, 2008 - 08:41 AM) *

Use SELECT DISTINCT in your query to eliminate the duplicates.


Can you give me an example please?
User is offlineProfile CardPM

Go to the top of the page

cumupkid
post 19 Mar, 2008 - 12:10 PM
Post #4


New D.I.C Head

*
Joined: 22 Jan, 2008
Posts: 9

QUOTE(cumupkid @ 19 Mar, 2008 - 12:03 PM) *

QUOTE(sansclue @ 19 Mar, 2008 - 08:41 AM) *

Use SELECT DISTINCT in your query to eliminate the duplicates.


Can you give me an example please?


never mind got it and thanks alot
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/15/08 04:28PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month