Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 SQL Statements & Display

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
JJenson Posted - 17 September 2007 : 21:02:53
Ok I am so close on this and I just don't know how to finish this off.

Lets start if you goto www.vmcplugins.com/forum/file_library.asp

If you see depending on if the file is free or paid based on a value in the database called F_ISFREE is shows in the bottom section or top section.

Now if you click on one of the links it goes into list all the files within that section. The problem is it shows both free and paid files. I need this to only display paid or free depending on the link they click.

Here is a .txt version of my file_library.asp:
www.vmcplugins.com/downloads/file_library.asp.txt

On lines 825 - 830 I have my strsql statement to try and display the list on the order to be paid or free using a querystring.

That is being passed on lines 415 and also 479.

I am stuck at this point on how to display this the way I need to can anyone help me from here? I would be greatly appreciated.

Thanks <
15   L A T E S T    R E P L I E S    (Newest First)
JJenson Posted - 20 September 2007 : 09:51:48
Don't scar me like that cause I am missing these dumb things all over the place <
Shaggy Posted - 20 September 2007 : 09:30:27
quote:
Originally posted by JJenson
I am hoping the more I do this I can just spot these things.
Believe me, the better you get the less easily you spot simple mistakes like this!

<
JJenson Posted - 20 September 2007 : 08:50:14
Yeah especially for me right now I am trying to grow and get better and better at all this but these things keep coming up that i overlook. I am hoping the more I do this I can just spot these things. We will see.<
Shaggy Posted - 20 September 2007 : 04:40:05
quote:
Originally posted by JJenson
Alright I found out my problem was that I didn't remove one quote also I needed to put a space a the beggining of the group by claus.
It's always the simple things, isn't it?!

<
JJenson Posted - 19 September 2007 : 13:55:19
Alright I found out my problem was that I didn't remove one quote also I needed to put a space a the beggining of the group by claus. Its all working now the way it should

www.vmcplugins.com/forum/file_library.asp

They get grouped the whole way down as they should <
ruirib Posted - 19 September 2007 : 13:52:20
Are you getting errors? If so, Response.Write the sql statement to see where the error is.

You should not use values from the querystring without sanitizing them.<
JJenson Posted - 19 September 2007 : 13:41:36
Ok this is what I got to change the where claus can someone tell me where I went wrong?


strSql = strSql & "WHERE F_CAT = " & showmethecat & " AND F_ISFREE = " & Request.QueryString("IsFree")
<
JJenson Posted - 19 September 2007 : 11:57:18
[edited]remove wrong information.[/edit]

OK I need t figure out how to get the where claus from the above statement into the below statment and I am not sure how to do it.


   strSql = "SELECT FC.F_CAT, FC.ID, COUNT(FF.ID) AS COUNTOFID "
   strSql = strSql & "FROM " & strTablePrefix & "FILECAT FC "
   strSql = strSql & "LEFT JOIN " & strTablePrefix & "FILEMANAGER FF "
   strSql = strSql & "ON FC.ID = FF.F_CAT "
   strSql = strSql & "WHERE F_ISFREE = " & Request.QueryString("IsFree")
   strSql = strSql & " GROUP BY FC.F_CAT, FC.ID "
   Set rsX2 = my_Conn.Execute (strSql)	
   
   strSql = "SELECT *"
   strSql = strSql & " FROM " & strTablePrefix & "FILEMANAGER "
   strSql = strSql & "WHERE F_CAT = " & showmethecat & " "
   strSql = strSql & "ORDER BY " & Sortme
   Set rs = Server.CreateObject("ADODB.Recordset")


So the rsX2 needs to be implemented into the rs statement anyone able to give me an idea on how to do this?

Thakns<
JJenson Posted - 19 September 2007 : 11:32:15
Ok so I believe the strsql is good I will try and see if I can track down the code that displays it and see if that needs tweaking. I also response.write the strsql and ran the query that it outputed and that displayed correct info as well. Must be further down then.

Thanks will post back I am sure when I can't find it <
JJenson Posted - 19 September 2007 : 10:20:52
Ok I got the right response.write statement and it comes back with the correct values.

When I click the free ones it displays a 1
When I click the paid ones it displays a 0

Not sure where to go from here though?<
JJenson Posted - 19 September 2007 : 09:49:36
I believe so this is basically how the original works but just adding in a where clause to make it only for the certain field of F_ISFREE. So everything else is basically the same with the where clause changing is all. Does that make sense?

<
gary b Posted - 19 September 2007 : 09:36:09
Line 827-828
quote:

strSql = strSql & "INNER JOIN " & strTablePrefix & "FILEMANAGER FF "
strSql = strSql & "ON FC.ID = FF.F_CAT "


This correct?<
JJenson Posted - 19 September 2007 : 08:39:08
Ok I did a response.write on the strsql I just want to make sure I did it correct.

Response.Write (IsFree)
Response.End

This showed nothing at all. Did I do this correct?<
JJenson Posted - 19 September 2007 : 08:29:26
I did it on the strsql and that shows it correct but I have not done it on the IsFree I will give that a try.<
Shaggy Posted - 19 September 2007 : 05:16:28
Have you tried a response.write on the IsFree & strSql variables to see if they are both set correctly?

<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000 Version 3.4.07