Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Location
    Los Angeles, Ca
    Posts
    2

    Unanswered: Showing records past 20 days ms SQL

    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
    %>

    <strong><font color="#FF0000" size="3">Here is where I want the the set made for new records within 20 days pulling from</font></strong>

    <%
    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

    %>

  2. #2
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    What is acutally wrong with your code?

    What errors?
    Pulling out my hair trying to get past date added to DB for listing
    Adding it to the DB should be easy.

    Do you mean displaying it in the output?

    You need to know the column name where the "past date" is stored.

  3. #3
    Join Date
    Jul 2003
    Location
    Ohio/Chicago
    Posts
    75
    can you actually just give us the DB schema and what you want to do? Who designed this code? This code is just all over the place, what the hell is Top8String used for? it's declared and set and never used, there's random table closings at the end,
    Here is where I want the the set made for new records within 20 days pulling from
    what's a set for new records? a table with a max of 20 records displayed?
    Plus trying to call image if date is within slotted number of days
    what's calling an image? displaying an image? What's Past Date? RHS98 understands but i don't, is that the day this script is run? The day the image was inserted into the DB? A column in the db?

    hopefully we can find a better way to do this....

    there's just too much going on and with not knowing anything about what you're doing and what you actually WANT to do. So can you just say this is the database and it's set up, my boss wants me to do this and this and display that.

    I'm not making fun of you, i understand you're new, just don't be afraid to talk in english and not code since you don't understand asp very well, that's how programs get done is the users telling you their specifications without knowing anything about the code.

  4. #4
    Join Date
    Aug 2003
    Location
    Los Angeles, Ca
    Posts
    2
    Well, to make it easy, maybe if whoever wants to talk about this in a quicker and easier way, maybe IM on icq or yahoo would work. My # is 14634570 or yahoo beachcrow2000. If we do it this way, I can explain it. The code does look confusing but once it is seen in action and what it does, you might understand a bit more.

    Joey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •