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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Variant on Portal Mod - Display Links error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

StephenD
Senior Member

Australia
1044 Posts

Posted - 28 April 2005 :  20:22:18  Show Profile  Send StephenD a Yahoo! Message
What's wrong with the following code? I'm trying to display downloads only which are in their own category, parent_id=5
sub DisplayDownloads(byval Width)

strSql = "SELECT"
	strSql = strSql & " LINK_ID,"
	strSql = strSql & " NAME"
	strSql = strSql & " POST_DATE"
	strSql = strSql & " PARENT_ID"
	strSql = strSql & " URL"
	strSql = strSql & " FROM " & strTablePrefix & "LINKS"
	strSql = strSql & " WHERE PARENT_ID = PARENT_ID"
	strSql = strSql & " AND PARENT_ID = 5"
	strSql = strSql & " ORDER BY POST_DATE DESC, NAME DESC"

       call StartTable("100%", "Latest Downloads")

    
	Set rsPopular = my_conn.Execute(TopSQL(strSql, strCMSLMCount))
	If NOT rsPopular.EOF Then
		Do While NOT rsPopular.EOF
		
			strLink = "              <DIV class=""listitem2""><a href=""links.asp?action=goto&id=" & rsPopular("LINK_ID") & """ "
			If strLMOpenMethod = "1" Then
				strLink = strLink & " target=""_blank"""
			End If
			strLink = strLink & ">" & getCurrentIcon(strIconArrows,"Download File","") & " " & " " & rsPopular("NAME") & "</a></DIV>" & vbNewLine

			Response.Write(strLink)
			
			rsPopular.MoveNext
		Loop
	End If
	rsPopular.Close
	Set rsPopular = Nothing	
		
       call EndTable()


I get an Incorrect syntax near 'PARENT_ID'.

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 29 April 2005 :  04:28:47  Show Profile
One thing I see is the lack of commas to seperate the fields you're selecting (except after LINK_ID). Even with that, I don't think it will work - what do you mean when you say "in their own category"?


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

StephenD
Senior Member

Australia
1044 Posts

Posted - 29 April 2005 :  04:32:57  Show Profile  Send StephenD a Yahoo! Message
Thanks Shaggy

I'm using Links Manager 3 Beta. I've got a Parent Category called Downloads. In the Links Table, it gives a reference of PARENT_ID=5.

I'd like the code to display most recent added urls (downloads) in this category.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 29 April 2005 :  04:35:47  Show Profile
You can probably remove the PARENT_ID=PARENT_ID part of the WHERE clause, so - inless I'm missing something. You just want to select all links with a PARENT_ID of 5, right?


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

StephenD
Senior Member

Australia
1044 Posts

Posted - 29 April 2005 :  04:36:36  Show Profile  Send StephenD a Yahoo! Message
Thats right...
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 29 April 2005 :  04:47:25  Show Profile  Send StephenD a Yahoo! Message
Actually, just looking at the db again and I think a join with the LINKS_CATEGORIES table to get CAT_ID is what is needed. I don't think that PARENT_ID links up.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.5 seconds. Powered By: Snitz Forums 2000 Version 3.4.07