Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - HELP need help with listing records date
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HELP need help with listing records date

 Post Reply Post Reply Page  123>
Author
AdultStarsMgr View Drop Down
Newbie
Newbie
Avatar

Joined: 17 August 2003
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote AdultStarsMgr Quote  Post ReplyReply Direct Link To This Post Topic: HELP need help with listing records date
    Posted: 17 August 2003 at 12:38pm

Pulling out my hair trying to get past date added to DB for listing
Plus trying to call image if date is within slotted number of days. I am tasked with this because of an unfinished project by someone else. ASP is a bit new to me. My code is below if anyone can suggest somethings.

set CatGirls = conntemp.execute("select thumb1, thumb2, thumb3, thumb4, thumb5, thumb6, thumb7, thumb8 from Categories where id = " & Category)

set CatName = conntemp.execute("select cat_name from Categories where id = " & Category)

<%
For x=0 to 7
If (CatGirls(x)) Then
set GirlName = conntemp.execute("select name, ad_title, incall, outcall, travel from Girls where id=" & CatGirls(x))
%>

<%
If (GirlName(2)) Then
%><img src="../images/icons/in.gif" alt="" width="11" height="30">
<%
End If

If (GirlName(3)) Then
%><img src="../images/icons/out.gif" alt="" width="11" height="30"><br>
<%
End If

If (GirlName(4)) Then
%><img src="../images/travel.gif" alt="" width="20" height="20">
<%
End If
%>



Here is where I want the the set made for new records within 20 days pulling from


<%
Top8String = Top8String & "," & CatGirls(x)
End If
Next
set RestOfGirls = conntemp.execute("select id, name, ad_title, incall, outcall, travel from Girls where active=1 AND id IN (select girl_id from CategoryGirl where cat_id = " & Category & ") order by id")

Do While Not RestOfGirls.eof
If (InStr(Top8String, RestOfGirls(0)) = 0) Then
%>
<%
If (RestOfGirls(3)) Then
%><img src="../images/icons/in.gif" alt="" width="11" height="30">
<%
End If
If (RestOfGirls(4)) Then
%><img src="../images/icons/out.gif" alt="" width="11" height="30"><br>
<%
End If
If (RestOfGirls(5)) Then
%><img src="../images/travel.gif" alt="" width="20" height="20">
<%
End If
%>

<%

End If

RestOfGirls.MoveNext
Loop

Set CatGirls = nothing
Set RestOfGirls = nothing

%>
</tr>
</table>
</body>
</html>

<%

Set CatGirls = Nothing
Set CatName = Nothing
CloseConnection

%>

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 3:52pm

...
  



Edited by pmormr
Back to Top
AdultStarsMgr View Drop Down
Newbie
Newbie
Avatar

Joined: 17 August 2003
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote AdultStarsMgr Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 5:22pm

Well, I am sorry for even posting such a question if I was that gifted dude. I thought this is where and why people come on here to share thoughts, help, etc. I must be wrong!

Just for your info, the code I put up works fine and all the strings, querries, and so on. So, maybe be a little more friendly, and less of a smart ass to be blunt here. If you would of read the beginning text of why and where I am on this thing instead of going to the code, you might of been a little less of an ass but then again, maybe not! Maybe I just came to the wrong board to be frank!

Happy Expert Coding ! 

Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 5:25pm

What field in your database holds the date? I can't see any in the SQL you have got there.

Blair

Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 5:43pm

It really sucks that your stuck in this position. I'm sorry if i came over as an asshole. Please post the entire code, clarify what your trying to do, and i'll be happy to fix it for you.

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 5:45pm
If you don't mind me asking, what kind of site are you writing this code for?
Back to Top
AdultStarsMgr View Drop Down
Newbie
Newbie
Avatar

Joined: 17 August 2003
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote AdultStarsMgr Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 5:51pm

Thats cool! I have no problem. But I have been trying several things for the last 2 days with this. I actually wanted to have the latest 20 days of NEW records open in the main index page but I will settle for it with the top header as the code attached is for.

*** This site works off of a side navigator, top scrolling navigator, bottom footer, and a main index page. So, it is not as easy as one may think or is it just me!!!

Code below for record list which also ties in with the main index when clicked, and ctrings from a category listing.

<%

Category = Request.ServerVariables("QUERY_STRING")

%><!--#include virtual="/include/Connection.asp"--><%

Dim Conntemp
OpenConnection

'set CatGirls = conntemp.execute("select id, name from Girls G, CategoryGirl CG where G.active=1 and G.id=CG.girl_id and CG.cat_id = " & Category)
set CatGirls = conntemp.execute("select thumb1, thumb2, thumb3, thumb4, thumb5, thumb6, thumb7, thumb8 from Categories where id = " & Category)
set CatName = conntemp.execute("select cat_name from Categories where id = " & Category)
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
@import url("/ccs/css_tophead.css");
-->
</style>
</head>

<body bgcolor="#FFCC00" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="1" cellpadding="0" cellspacing="1" bordercolor="#003366" bgcolor="#003399"><!--DWLayoutTable-->
  <tr>
    <%

For x=0 to 7
 If (CatGirls(x)) Then
  set GirlName = conntemp.execute("select name, ad_title, incall, outcall, travel from Girls where id=" & CatGirls(x))
%>
    <td valign="top">
      <table border="0" cellpadding=1 cellspacing=2 bordercolor="#0033CC">
        <tr>
          <td colspan=2 align=center valign="top" nowrap bgcolor="#660099"><font size="2" face="Arial, Helvetica, sans-serif"><a href="girldetail.asp?girl=<%=CatGirls(x)%>&pic=1&cat=<%=Category%>" target="mainFrame"><strong><%=GirlName(0)%></strong></a></font></td>
        </tr>
        <tr>
          <td bgcolor="#660099"><a href="girldetail.asp?girl=<%=CatGirls(x)%>&pic=1&cat=<%=Category%>" target="mainFrame"><img src="/pictures/<%=CatGirls(x)%>/thumbs/1.jpg" alt="" border=0 align="absmiddle"></a></td>
          <td align="right" nowrap bgcolor="#660099">            <%
  If (GirlName(2)) Then
   %>            <img src="../images/icons/in.gif" alt="" width="11" height="30">            <%
  End If

  If (GirlName(3)) Then
   %>            <img src="../images/icons/out.gif" alt="" width="11" height="30"><br>           
            <%
  End If

  If (GirlName(4)) Then
   %>            <img src="../images/travel.gif" alt="" width="20" height="20">            <%
  End If
%>
          </td>
        </tr>
        <tr>
          <td colspan=2 align=center nowrap bgcolor="#FFCC00"><font color="#0000FF" face="Arial, Helvetica, sans-serif" size="-2"><b><%=GirlName(1)%></b></font></td>
        </tr>
      </table>
    </td>
    <td valign="top" bgcolor="#0066CC">&nbsp;</td>
    <%
    Top8String = Top8String & "," & CatGirls(x)
    End If

Next

set RestOfGirls = conntemp.execute("select id, name, ad_title, incall, outcall, travel from Girls where active=1 AND id IN (select girl_id from CategoryGirl where cat_id = " & Category & ") order by id")

Do While Not RestOfGirls.eof

 If (InStr(Top8String, RestOfGirls(0)) = 0) Then

%>
    <td valign="top"><table border="0" cellpadding=1 cellspacing=2>
        <tr bgcolor="#660099">
          <td colspan=2 align=center valign="top" nowrap><font size="2" face="Arial, Helvetica, sans-serif"><a href="girldetail.asp?girl=<%=RestOfGirls(0)%>&pic=1&cat=<%=Category%>" target="mainFrame"><strong><%=RestOfGirls(1)%></strong></a></font></td>
        </tr>
        <tr>
          <td nowrap bgcolor="#660099"><a href="girldetail.asp?girl=<%=RestOfGirls(0)%>&pic=1&cat=<%=Category%>" target="mainFrame"><img src="/pictures/<%=RestOfGirls(0)%>/thumbs/1.jpg" alt="" border=0 align="absmiddle"></a></td>
          <td align="right" nowrap bgcolor="#660099">            <%
  If (RestOfGirls(3)) Then
   %>            <img src="../images/icons/in.gif" alt="" width="11" height="30">            <%
  End If

  If (RestOfGirls(4)) Then
   %>            <img src="../images/icons/out.gif" alt="" width="11" height="30"><br>           
            <%
  End If

  If (RestOfGirls(5)) Then
   %>            <img src="../images/travel.gif" alt="" width="20" height="20">            <%
  End If
%>
          </td>
        </tr>
        <tr bgcolor="#FFCC00">
          <td colspan=2 align=center nowrap bordercolor="#FFCC00"><font color="#0000FF" face="Arial, Helvetica, sans-serif" size="-2"><b><%=RestOfGirls(2)%></b></font></td>
        </tr>
   &nb

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2003 at 5:56pm
so let me get this straight, you want the records that are dated within the last 20 days to be displayed?
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.