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'.