Display Records in certain order (string contained in field)
- From: "Randy" <*randyfromsono@xxxxxxxxx>
- Date: Sat, 2 Aug 2008 12:28:42 -0400
Just can't figure out how to do this..........
I have a simple asp page that desplays images from database.
The query on my page:
-------------------------
imagequery = "SELECT * FROM FILE_LIST WHERE CLASS_ID=" & FORM_ID
------------------------
The table FILE_LIST contains a field called TITLE which never gets
displayed.
(the form_id comes from a selection on previous page)
I display the images with a do loop as follows:
---------------------------
<%
set rstemp=conntemp.execute(imagequery)
If rstemp.EOF Then
Form_file_ID = 0
Else
do while not rstemp.eof
%>
<CENTER><IMG SRC="imagehelper.asp?FILE_id=<% = rstemp("FILE_id")
%>"></CENTER>
<%
rstemp.movenext
loop
END IF
rstemp.close
set rstemp=nothing
%>
--------------------------
I want to have the images that have the string 'photo' within the 'TITLE'
field disply FIRST
(eg. one with the title 'A photo of a cat' would desplay before 'A drawing
of a Cat' )
and THEN the ones that don'tt. I think I can accomplish this some kind of
if statement in the loop,
but I just cant get it to work without the ones containing 'photo'
displaying twice.
I hope I've explained this adequately.
Thanks in advance to anyone who has any ideas.
.
- Follow-Ups:
- Re: Display Records in certain order (string contained in field)
- From: Bob Barrows [MVP]
- Re: Display Records in certain order (string contained in field)
- Prev by Date: RE: Getting info from Drop Down
- Next by Date: Re: Display Records in certain order (string contained in field)
- Previous by thread: Getting info from Drop Down
- Next by thread: Re: Display Records in certain order (string contained in field)
- Index(es):
Relevant Pages
|
Loading