<table cellpadding=2 cellspacing=1 width=780 border=0>
<tr align=center height=25 bgcolor=#ffcc00>
<td width=85 class="style1">ลำดับที่</td>
<td width=380 class="style1">ชื่อเรื่อง</td>
<td width=110 class="style1">วันที่ส่ง</td>
<td width=32 class="style1">อ่าน</td>
<td width=32 class="style1">ตอบ</td>
<td width=110 class="style1">ตอบล่าสุด</td>
</tr>
<%
sql="select * from bbs where "
sql=sql&" topic_id=reply_id "
sql=sql&" order by date_post desc"
set rs=Conn.Execute(sql)
Rs.open sql,conn,1,3
totalrows = 0
if not Rs.eof and not Rs.bof then
do while not rs.eof
TotalRows1 = Rs.Recordcount
Rs.Pagesize =3
TotalPages = Rs.Pagecount
PageNo=1
if Request("PageNo") <> "" then
PageNo=Request("PageNo")
end if
Rs.Absolutepage = PageNo
end if
%>
<%
if not Rs.eof then
RowCount = 1
While NOT Rs.EOF and RowCount <= Rs.Pagesize
%>
<tr valign=top align=center bgcolor=f4f4f4>
<td width="85" class="style1"># <%=rs("topic_id")%></td>
<td width="380" align=left class="style1"><b><a href=bbs_open.asp?id=<%=rs("topic_id")%>><%=rs("title")%></a></b><br>
ผู้ส่ง <%=rs("poster")%>
</td>
<td width="110" class="style1"><%
response.write formatdatetime(rs("date_post"),1)&"<br>"
response.write formatdatetime(rs("date_post"),4)%></td>
<td width="32" class="style1"><%=rs("reads")%></td>
<td width="32" class="style1"><%=ctopic(rs("topic_id"))%></td>
<td width="110" class="style1"><%
if datediff("s",rs("date_reply"),rs("date_post"))=0 then
response.write "<br>"
else
response.write formatdatetime(rs("date_reply"),1)&"<br>"
response.write formatdatetime(rs("date_reply"),4)&"<br>"
if rs("post_reply")<>"" then
response.write "["&rs("post_reply")&"]"
end if
end if
%></td>
</tr>
<%
RowCount = RowCount + 1
rs.movenext
Wend
loop
else
response.write "<tr height=60><td colspan=6 align=center bgcolor=#f4f4f4>ไม่พบข้อความในฐานข้อมูล.</td></tr>"
end if
set rs=nothing
%>
</table>
<br>
<table width="780" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="7">หน้าที่
<%
for P_i = 1 to TotalPages
Response.Write "<a href=""bbs.asp?PageNo="&P_i&""">"
if P_i = (PageNo+1)-1 then
Response.Write "<font size=""1"" color=#FF0099>"
else
Response.Write "<font size=""1"" color=#000000>"
end if
Response.Write "[" & P_i & "]" & "</font></a> "
next
%></td>
</tr>
</table>
</div>
</body>
</html>
<%
function ctopic(x)
ctopic=0
sqlc="select count(reply_id) as topic from bbs where cstr(topic_id)='"&x&"' "
set rsc=Conn.Execute(sqlc)
if not rsc.eof then
ctopic=rsc("topic")-1
end if
set rsc=nothing
end function
%>
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/bbs/bbs.asp, line 74
end if
จาก modx777
Date :
17 มิ.ย. 2548 13:21:43
By :
modx777
No. 3
Guest
มันฟ้องว่า
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/bbs/bbs.asp, line 74 ------------- แล้วมันตรงไหนล่ะ ชี้ให้ดูหน่อย
end if
Date :
17 มิ.ย. 2548 17:08:21
By :
oreo
No. 4
Guest
<%
sql="select * from bbs where "
sql=sql&" topic_id=reply_id "
sql=sql&" order by date_post desc"
set rs=Conn.Execute(sql)
Rs.open sql,conn,1,3
totalrows = 0
if not Rs.eof and not Rs.bof then
do while not rs.eof
TotalRows1 = Rs.Recordcount
Rs.Pagesize =3
TotalPages = Rs.Pagecount
PageNo=1
if Request("PageNo") <> "" then
PageNo=Request("PageNo")
end if
Rs.Absolutepage = PageNo
end if----------------------------------------------error ตรงนี้
%>