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)
 Logic for Modification to File Library?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JJenson
Advanced Member

USA
2121 Posts

Posted - 12 September 2007 :  23:05:56  Show Profile  Visit JJenson's Homepage  Reply with Quote
Ok I hope I can explain what I am trying to do here and I am hoping someone can help me with the logic on how to go about accomplishing this.

First here is the link to the file library which I am making the modifications to: http://www.vmcplugins.com/forum/file_library.asp

Ok now I will try to explain as best I can:

I need to be able to specify when uploading a file if it goes into Free Downloads or Paid Downloads

I want to be able to sort the categories however I see fit from the admin section kind of how the forums and categories are aligned.

I am not sure all the logic that would be needed to do something like this I mainly got my layout how I need it and now am trying to figure out how to attack what I am trying to do. Mainly seperate Free and Paid and be able to order them how I need to.

Thanks

<

JJenson
Advanced Member

USA
2121 Posts

Posted - 16 September 2007 :  00:10:36  Show Profile  Visit JJenson's Homepage  Reply with Quote
OK I think I am getting through this but I am a little stuck in one spot here.

I have this code to display what is in the database as Forum Version this is the code:


if MyVersion = "0" or MyVersion = "" then
Response.Write "N/A"
else
strSql = "SELECT F_VERSION "
strSql = strSql & "FROM " & strTablePrefix & "FILEVERSION "
strSql = strSql & "WHERE ID IN (" & MyVersion & ")"
Set rsY = my_Conn.Execute (strSql)
rsY.MoveFirst
while not rsY.EOF
Response.Write rsY("F_VERSION") & "<br />"
rsY.MoveNext
wend
rsY.Close
end if


I am trying to put into this statement.

strSql = "SELECT FC.ID, FC.F_CAT, 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 & "GROUP BY FC.F_CAT, FC.ID"


I want to take the forum version which in the database is called Free and put it into the above statement.

I think it needs to look something like this?

if strSql = "SELECT F_VERSION "
strSql = strSql & "WHERE ID IN = Free"
then
strSql = "SELECT FC.ID, FC.F_CAT, 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 & "GROUP BY FC.F_CAT, FC.ID"


How would I put that into the SQL Statement?<

Edited by - JJenson on 16 September 2007 00:29:08
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 16 September 2007 :  09:54:49  Show Profile  Visit JJenson's Homepage  Reply with Quote
OK so looking at this closer and closer I think I don't need the if statement at all I just need to get all the strsql statements correct.

I tried this the page shows but it is not limiting the free section to just the files marked as free this is the code I have:


strSql = "SELECT F_VERSION "
strSql = strSql & "WHERE ID IN Free"
strSql = "SELECT FC.ID, FC.F_CAT, 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 & "GROUP BY FC.F_CAT, FC.ID"


<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 16 September 2007 :  13:14:11  Show Profile  Visit JJenson's Homepage  Reply with Quote
Ok so with the help of some others I changed up how I am doing this and have the query's running right now I just need to get me SQL statments right.

Here is what I have:

strSql = "SELECT FORUM_FC.ID, FORUM_FC.F_CAT, COUNT(FORUM_FILEMANAGER.ID) AS COUNTOFID "
strSql = strSql & "FROM " & strTablePrefix & "FILECAT FC "
strSql = strSql & "INNER JOIN " & strTablePrefix & "FILEMANAGER "
strSql = strSql & "FORUM_FC.ID = FORUM_FILEMANAGER.F_CAT "
strSql = strSql & "WHERE FORUM_FILEMANAGER.ISFREE = 1 "
strSql = strSql & "GROUP BY FORUM_FC.F_CAT, FORUM_FC.ID"


This is the error I get with that any ideas?

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.1.20-max-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.ID = FORUM_FILEMANAGER.F_CAT WHERE FORUM_FILEMANAGER.ISFREE = 1 GROUP BY FORUM_' at line 1

/forum/file_library.asp, line 408

ANyone know how I can change this?

Thanks
<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 16 September 2007 :  13:33:11  Show Profile  Visit JJenson's Homepage  Reply with Quote
OK got it this is the code that works:


strSql = "SELECT FC.ID, FC.F_CAT, COUNT(FF.ID) AS COUNTOFID "
strSql = strSql & "FROM " & strTablePrefix & "FILECAT FC "
strSql = strSql & "INNER JOIN " & strTablePrefix & "FILEMANAGER FF "
strSql = strSql & "ON FC.ID = FF.F_CAT "
strSql = strSql & "WHERE FF.ISFREE = 1 "
strSql = strSql & "GROUP BY FC.F_CAT, FC.ID "
<
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 17 September 2007 :  21:39:40  Show Profile  Visit JJenson's Homepage  Reply with Quote
Hmm strange works on some but not others. WIll have a look at it. I mean some categories are showing right and others are not showing correct.

Thanks<

Edited by - JJenson on 17 September 2007 21:40:24
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 17 September 2007 :  22:53:24  Show Profile  Visit JJenson's Homepage  Reply with Quote
Fixed now my only problem is with my sql where clause to only show what I need it to show I have posted it here.

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=65601

Thanks<
Go to Top of Page
  Previous Topic Topic Next Topic  
 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 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07