Leave a message for Brandon in the Guestbook:
|
<%
Dim mySQL, UDate, FDate, FTime, Header, Body, UserName, FirstName, LastName, ID, showcomment, HaloName
courseID = Request.Querystring("courseID")
showcomment=0
HaloName="BrandonMessage"
mySQL="SELECT messages.FDate, messages.Header, messages.Body, users.UserName, users.FirstName, users.LastName, messages.ID "
mySQL=mySQL & "FROM messages, users "
mySQL=mySQL & "WHERE messages.UID = users.UID "
mySQL=mySQL & "ORDER BY messages.FDate DESC"
dim conntemp, rstemp
set conntemp=server.createobject("adodb.connection")
conntemp.open strconn
set rstemp=conntemp.execute(mySQL)
howmanyfields=rstemp.fields.count -1%>
<% 'Put Headings On The Table of Field Names
loopcount=1
for i=0 to howmanyfields
%>
<% next %>
<% ' Now lets grab all the records
do while not rstemp.eof %>
<% for i = 0 to howmanyfields
thisvalue=rstemp(i)
If isnull(thisvalue) then
thisvalue=" "
end if
if i=0 then
UDate=thisvalue
end if
FDate=FormatDateTime(UDate, 1)
FTime=FormatDateTime(UDate, 3)
if i=1 then
Header=thisvalue
end if
if i=2 then
Body=thisValue
end if
if i=3 then
UserName=thisValue
end if
if i=4 then
FirstName=thisValue
end if
if i=5 then
LastName=thisValue
end if
if i=6 then
ID=thisValue
end if
%>
<% next %>
<%
Response.Write "
" & FDate & "
" & chr(10)
Response.Write ""
Response.Write "
" & Body & "
Posted by " & UserName & " (" & FirstName & " " & LastName & ") @ " & FTime & "
"
%>
<%rstemp.movenext
loop%>
<%
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
%>