Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 08-19-2003, 09:10 AM
  #16
scoutt
Mister Admin to you
 
scoutt's Avatar
 
Join Date: Jul 2001
Posts: 30,867
iTrader: (0)
scoutt is a jewel in the roughscoutt is a jewel in the roughscoutt is a jewel in the roughscoutt is a jewel in the rough
thanks Johan. I will give you the credit
__________________
Have a Script or Snippet you want to share?

WWW Standards: HTML 4.01, CSS2.1, CSS3, XHTML 1.0
PHP Standards: PHP Standards
scoutt is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-19-2003, 10:34 AM
  #17
putts
SELECT MINE FROM TITLES
 
putts's Avatar
 
Join Date: Nov 2002
Location: Frankenmuth, MI
Posts: 4,930
iTrader: (0)
putts has a spectacular aura aboutputts has a spectacular aura about
Try to post this last night, but HTMLForums was hating me...

Switch your select statement to something like

PHP Code:
SELECT FIRSTNAME,LASTNAME,LEFT(FIRSTNAME,1) AS FIRSTLETTER FROM EMPLOYEES ORDER BY FIRSTLETTER 
Now, while doing the loop, watch for that firstletter to change....
PHP Code:
dim firstlet
dim recSet
dim strSQL

strSQL 
"SELECT FIRSTNAME,LASTNAME,LEFT(FIRSTNAME,1) AS FIRSTLETTER FROM EMPLOYEES ORDER BY FIRSTLETTER"

set recSet db.execute(strSQL)
%>
<
table>
<%
if 
not(recSet.eofthen
   firstLet 
recSet(&quot;FIRSTLETTER&quot;)
   while 
not(recSet.eof)
       if 
recSet(&quot;FIRSTLETTER&quot;) <> firstLet%>
          <
tr><td><%=recSet(&quot;FIRSTLETTER&quot;)%></td></tr>
       <%
end if
       
firstlet recSet(&quot;FIRSTLETTER&quot;)
       %>
       <
tr><td><%=recSet(&quot;FIRSTNAME&quot;) & &quot; &quot; & recSet(&quot;LASTNAME&quot;)%></td></tr>
       <% 
       
recSet.moveNext
   wend
end 
if%>
</
table
That's a good example on how to something like that.

So, there it is.
__________________
Signature Image Rotator will return when I have time to fix it

Running Scoreboard
Anthony : 3 points
putts is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-19-2003, 02:25 PM
  #18
Johan
Paladin (Level 15)
 
Johan's Avatar
 
Join Date: May 2001
Location: Aldershot, England
Posts: 325
iTrader: (0)
Johan is on a distinguished road
Thats looks great Putts thanks. What I want to do with it is showing all my reviews on one page. This is mainly for search engine spider reasons.

This on the BBC website is perfect http://www.bbc.co.uk/music/reviews/atoz.shtml
and want to show my reviews in the same way.

I have greater plans for the navigation to work and once I have done it will post the code here.

Last edited by Johan : 08-19-2003 at 02:29 PM.
Johan is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-24-2003, 08:21 AM
  #19
Johan
Paladin (Level 15)
 
Johan's Avatar
 
Join Date: May 2001
Location: Aldershot, England
Posts: 325
iTrader: (0)
Johan is on a distinguished road
http://www.futuremovies.co.uk/review.asp

It works but as you can it will not print the very first letter/number "2"

PHP Code:
strSql "SELECT Title, LEFT(Title,1) AS FIRSTLETTER, Review.ID AS [reviewID] FROM review WHERE Review.Delete<>'Y' ORDER BY Title"
        
Set db Server.CreateObject("ADODB.Connection")
        
Set Rs Server.CreateObject("ADODB.Recordset")
        
db.Open "DSN=futuremovies"
        
Rs.Open strSqldb


           
If Not(Rs.eofthen
            firstLet 
Rs("FIRSTLETTER")
            While 
Not(Rs.eof)
                If 
Rs("FIRSTLETTER") <> firstLet Then
                    out 
out "<tr><td><br>"

                    
out out "<font size=""3""><b>" Rs("FIRSTLETTER") & "</b></font>"

                    
out out "</td></tr>"
                
End If
                
                
firstlet Rs("FIRSTLETTER")
                
                
out out "<tr><td>"
                
                
out out "<a href=""/moviesite/review.asp?ID=" intID """>"
                
out out Rs("Title"
                
out out "</a>"
                    
                
out out "</td></tr>"
                
Rs.MoveNext
            wEnd
        End 
If 

Last edited by Johan : 09-26-2003 at 07:35 AM.
Johan is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-28-2003, 05:56 PM
  #20
Johan
Paladin (Level 15)
 
Johan's Avatar
 
Join Date: May 2001
Location: Aldershot, England
Posts: 325
iTrader: (0)
Johan is on a distinguished road
SORTED I just initialised the variable to ""



If Not(Rs.eof) then
firstLet = ""
While Not(Rs.eof)
If Rs("FIRSTLETTER") <> firstLet Then
out = out & "<tr><td><br>"

out = out & "<font size=""3""><b>" & Rs("FIRSTLETTER") & "</b></font>"

out = out & "</td></tr>"
End If

firstlet = Rs("FIRSTLETTER")

out = out & "<tr><td>"

out = out & "<a href=""/moviesite/review.asp?ID=" & intID & """>"
out = out & Rs("Title")
out = out & "</a>"

out = out & "</td></tr>"
Rs.MoveNext
wEnd
End If
Johan is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-29-2003, 09:34 AM
  #21
putts
SELECT MINE FROM TITLES
 
putts's Avatar
 
Join Date: Nov 2002
Location: Frankenmuth, MI
Posts: 4,930
iTrader: (0)
putts has a spectacular aura aboutputts has a spectacular aura about
BRAVO!!

Good job!

The site looks realll nice.
__________________
Signature Image Rotator will return when I have time to fix it

Running Scoreboard
Anthony : 3 points
putts is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-02-2003, 04:00 AM
  #22
Johan
Paladin (Level 15)
 
Johan's Avatar
 
Join Date: May 2001
Location: Aldershot, England
Posts: 325
iTrader: (0)
Johan is on a distinguished road
Chears for you help Putts - if you want any free design work done then let me know.
Johan is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-27-2003, 05:54 PM
  #23
Johan
Paladin (Level 15)
 
Johan's Avatar
 
Join Date: May 2001
Location: Aldershot, England
Posts: 325
iTrader: (0)
Johan is on a distinguished road
Another way of paging:

http://www.asp101.com/samples/db_paging.asp

Damn good site that!
__________________
Johan De Silva

My movie reviews | New and old games consoles | web design | gift ideas
Johan is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 02:32 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.