Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 SQL Statements & Display
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

JJenson
Advanced Member

USA
2121 Posts

Posted - 17 September 2007 :  21:02:53  Show Profile  Visit JJenson's Homepage  Reply with Quote
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 <

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 September 2007 :  04:39:11  Show Profile  Reply with Quote
quote:
Originally posted by JJenson
goto www.vmcplugins.com/forum/file_library.asp
Got a test account for us?

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 September 2007 :  08:43:33  Show Profile  Visit JJenson's Homepage  Reply with Quote
Oh yeah sorry

user: snitz
pass: test<
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 18 September 2007 :  09:09:50  Show Profile  Reply with Quote
cLng(Request.QueryString("IsFree")) Have you tried that?<

    _-/Cripto9t\-_
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 September 2007 :  09:15:34  Show Profile  Visit JJenson's Homepage  Reply with Quote
Ok that did the same as the other. This is how I made the line look.

strSql = strSql & "WHERE F_ISFREE = " & cLng(Request.QueryString("IsFree"))


Also you can view it now without being logged in. SOrry about that didn't even know you had to be logged in to see it. <

Edited by - JJenson on 18 September 2007 09:31:31
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 September 2007 :  13:40:53  Show Profile  Visit JJenson's Homepage  Reply with Quote
Ok trying to go a different route here I tried passing a variable like so:


Dim IsFree : IsFree = Request.QueryString("IsFree")


Then putting this in my strsql statement.

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 = "WHERE F_ISFREE = " & IsFree & ""
strSql = strSql & " GROUP BY FC.F_CAT, FC.ID "
Set rsX2 = my_Conn.Execute (strSql)


But this did not work either what am I missing cause I am lost as usual<
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 18 September 2007 :  13:59:22  Show Profile  Visit modifichicci's Homepage  Reply with Quote
what kind of field is F_ISFREE? int or charvar?<

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 September 2007 :  14:05:56  Show Profile  Visit JJenson's Homepage  Reply with Quote
int

The value is 0=Paid and 1=Free just so know what the values are in the column<

Edited by - JJenson on 18 September 2007 14:06:37
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 18 September 2007 :  17:12:17  Show Profile  Visit modifichicci's Homepage  Reply with Quote
mmmm not FF.F_ISFREE in the query?<

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 18 September 2007 :  21:33:58  Show Profile  Visit JJenson's Homepage  Reply with Quote
just tried that in the where claus and it didn't work.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 19 September 2007 :  05:16:28  Show Profile  Reply with Quote
Have you tried a response.write on the IsFree & strSql variables to see if they are both set correctly?

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 19 September 2007 :  08:29:26  Show Profile  Visit JJenson's Homepage  Reply with Quote
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.<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 19 September 2007 :  08:39:08  Show Profile  Visit JJenson's Homepage  Reply with Quote
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?<
Go to Top of Page

gary b
Junior Member

USA
267 Posts

Posted - 19 September 2007 :  09:36:09  Show Profile  Visit gary b's Homepage  Reply with Quote
Line 827-828
quote:

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


This correct?<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 19 September 2007 :  09:49:36  Show Profile  Visit JJenson's Homepage  Reply with Quote
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?

<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 19 September 2007 :  10:20:52  Show Profile  Visit JJenson's Homepage  Reply with Quote
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?<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.41 seconds. Powered By: Snitz Forums 2000 Version 3.4.07