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
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

JJenson
Advanced Member

USA
2121 Posts

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

JJenson
Advanced Member

USA
2121 Posts

Posted - 19 September 2007 :  11:57:18  Show Profile  Visit JJenson's Homepage  Reply with Quote
[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<

Edited by - JJenson on 19 September 2007 13:28:42
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 19 September 2007 :  13:41:36  Show Profile  Visit JJenson's Homepage  Reply with Quote
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")
<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 September 2007 :  13:52:20  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
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.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 20 September 2007 :  04:40:05  Show Profile  Reply with Quote
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?!

<

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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 20 September 2007 :  09:30:27  Show Profile  Reply with Quote
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!

<

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 - 20 September 2007 :  09:51:48  Show Profile  Visit JJenson's Homepage  Reply with Quote
Don't scar me like that cause I am missing these dumb things all over the place <
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous 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.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07