Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- Dim sConnectionNewsTitle, objConnNewsTitle , objRSNewsTitle
- sConnectionNewsTitle = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=ihacker; UID=root;PASSWORD=; OPTION=3"
- Set objConnNewsTitle = Server.CreateObject("ADODB.Connection")
- objConnNewsTitle.Open(sConnectionNewsTitle)
- ' strSQL2 = ("SELECT * FROM news_cat")
- 'set objRS2 = objConn2.Execute(strSQL2)
- 'strSQLNewsTitle = ("SELECT news.*,news_cat.* FROM news INNER JOIN news_cat ON(news.news_cat_id = news_cat.news_cat_id)")
- 'set objRSNewsTitle = objConnNewsTitle.Execute(strSQLNewSTitle)
- ' while not objRS2.EOF
- ' Response.Write("<h1><a href=cats.asp?name=" & objRS2("news_cat_name") & ">" & objRS2("news_cat_name") & "</a></h1>")
- ' while not objRSNewsTitle.EOF
- ' if objRS2("news_cat_id") = objRSNewsTitle("news_cat_id") then
- ' Response.Write("<ul><li><a href=cats?name=" & objRSNewsTitle("news_cat_name") & "&id=" & objRSNewsTitle("news_id") & ">" & objRSNewsTitle("news_title") & "</a></li></ul>" )
- ' objRSNewsTitle.MoveNext
- ' else
- ' Response.Write("<ul><li>Not Found</li></ul>")
- ' end if
- ' Wend
- ' objRS2.MoveNext
- ' Wend
- strSQL2 = ("SELECT * FROM news_cat")
- set objRS2 = objConn2.Execute(strSQL2)
- while not objRS2.EOF
- strSQLNewsTitle = ("SELECT news.* FROM news WHERE news_cat=".strSQL2("news_cat_id"))
- set objRSNewsTitle = objConnNewsTitle.Execute(strSQLNewSTitle)
- while not objRSNewsTitle.EOF
- Response.write(strSQLNewsTitle("news_title"))
- objRSNewsTitle.MoveNext
- wend
- objRS2.MoveNext
- Wend
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement