Image

Imagesuperbrava wrote in Imagephp

ASP Help

I've already had a few comments in the webdesign community, but they had nothing to do with my code problem listed below, so i've deleted the post, and i'm putting it here. i hope someone will have some idea what is wrong.

problem: i want to alternate table row colors w/ asp. i've only messed with asp for 3 days, i usually only program in php.

if you have any input, i would be very appreciative.

I can't find a single asp community. Maybe LJ's search isn't working correctly, cause that is really amazing that there isn't any.

Well, I just started learning ASP 3 days ago, and I want to alternate table row colors. Here is the code, and I have NO idea why it wont work.



<%@ language="VBScript" %>
<!--#include file="system/config.asp"-->    (Includes DB connection and all that stuff)

<!-- Table:  Query DB Articles For News //-->
<table cellpadding="4" cellspacing="0" border="0" summary="">
<%
				
query = "SELECT * FROM articles WHERE category = 'News' ORDER BY article_id DESC LIMIT 0,5"
set rsResult = dbconn.Execute(query)
rsRecordCount = rsResult.recordcount
				
i=0
do while i <= rsRecordCount-1
	comments = rsResult("comments")
	if comments <> 1 then
		comments_text = "Comments"
	else
		comments_text = "Comment"
	end if
	
        ' Problem area below.............
				
	if i/2 then
		bgcolor = "#EBEBEB"
	else
		bgcolor = "#FFFFFF"
	end if
        
        

				
%>
	
	<tr>
	<td bgcolor="<%= bgcolor %>"><b><%= rsResult("topic") %></b></td>
	</tr>
	<tr>
	<td bgcolor="<%= bgcolor %>">Posted on <%= rsResult("post_date") & " "
	(continued -->) & rsResult("post_time") %> by <a href="mailto:<%= rsResult("email") %>">
	(continued -->) <%= rsResult("author") %></a> (<%= rsResult("post_ip") %>)</td>
	</tr>
	<tr>
	<td bgcolor="<%= bgcolor %>"><%= rsResult("abstract") %> ... 
	(continued -->)<a href="articles.asp?article_id=<%= rsResult("article_id") %>">Read More
	(continued -->) »</a></td>
	</tr>
	<tr>
	<td bgcolor="<%= bgcolor %>" align="right"><a href="post_comments.asp?article_id=
	(continued -->)<%= rsResult("article_id") %>">Post Comment</a> «|» 
	(continued -->)<a href="read_comments.asp?article_id=<%= rsResult("article_id") %>">
	(continued -->)<%= rsResult("comments") & " " & comments_text %></a></td>
	</tr>
	<tr>
	<td bgcolor="<%= bgcolor %>"> </td>
	</tr>

<%
				
i=i+1
rsResult.movenext
loop
				
rsResult.close
				
%>
</table>
<!-- Table:  Query DB Articles For News //-->



if you have any ideas what i am doing wrong, please let me know! i kinda just tried to jump into ASP head first, and I have no prior ASP or VBScript knowledge.. :)

Thanks ;)