Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 guestbook v3, display question:
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wedont
Junior Member

Canada
344 Posts

Posted - 16 June 2001 :  17:15:14  Show Profile
I successfuly installed the guestbook
But I want to display the latest comment on my "portal" entrance page (linked to a pop_guestbook)So I just want to know how to call the "latest" entry in my sql statement!

Thanks,

Wedont
snitz ver3.1 sr2
access 2k.

e3stone
Average Member

USA
885 Posts

Posted - 16 June 2001 :  20:10:44  Show Profile  Send e3stone an AOL message
This would be similar to the "Welcome our newest member:" feature. The sql statement for that is:

'## Forum_SQL - Get newest membername and id from DB
strSql = "SELECT M_NAME, MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS WHERE M_STATUS=1 AND MEMBER_ID > 1"
strSql = strSQL & " ORDER BY M_DATE desc;"
set rs = my_Conn.Execute(strSql)
if not rs.EOF then
NewMember_Name = ChkString(rs("M_NAME"), "display")
NewMember_Id = rs("MEMBER_ID")
else
NewMember_Name = ""
end if


It would be the same except, of course, you'd change the "select" fields and then order by "G_DATE" which is the date field in the Guestbook table.

Hope this helps a little

<-- Eric -->


InsideWaco.com
Go to Top of Page

wedont
Junior Member

Canada
344 Posts

Posted - 16 June 2001 :  21:40:21  Show Profile
Thanks again Eric, it worked:
the code in guessbook.asp starting line 26 (set countrs = my_conn.execute...)
is changed to:

set countrs = my_conn.execute("SELECT G_ID FROM " & strTablePrefix & "GUESTBOOK" & " ORDER BY G_DATE desc;")
if not countrs.EOF then
strLastone = ChkString(countrs("G_ID"), "display")
end if
rec = 0
do until countrs.eof
rec = rec + 1
countrs.movenext
Loop

set countrs = nothing

strTotalRecords = rec


Where "strLastone" become my variable to display the latest entry from the guessbook into my "portal".

Thanks

Wedont
snitz ver3.1 sr2
access 2k.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07