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

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Help on a thing I'm doing using SQL
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

golfmann
Junior Member

United States
450 Posts

Posted - 23 February 2006 :  01:19:51  Show Profile  Visit golfmann's Homepage
I am stuck! What I am trying to do is have each MEMBERS zip code used in a weather mod I have shoehorned into our sidebar.

Code I used is this:
if strEnableWeather = "1" then
		strSql = "SELECT ME.MEMBER_ID, ME.M_ZIP " & _
         		 "FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME " & _
        		 "WHERE AU.MEMBER_ID = ME.MEMBER_ID"
		set rsZ = my_conn.execute (strSql)

%>
<!--#INCLUDE FILE="include/inc_spacer.asp"--><!--#INCLUDE FILE="include/inc_spacer.asp"-->
<%
Response.Write"<table width=""100%"" align=""center"" border=""0"" cellspacing=""0"" cellpadding=""0""  bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""middle"" align=""center"" bgcolor=""" & strHeadCellColor & """ ><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """> <b>" & strSidebarDelimiter & " " & strWeatherDisplayName & " " & strSidebarDelimiter & "</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""middle"" align=""center"" bgcolor=""" & strForumCellColor & """><a href=""" & strWeatherIMGLinkTo  & Trim (rsZ("M_ZIP")) & """ target=_blank><img valign=""center"" src="""& strWeatherIMGUrl & Trim (rsZ("M_ZIP")) & """ WIDTH=""170"" HEIGHT=""100"" BORDER=""0"" alt=""enter YOUR zip code in your PROFILE for your local weather""></a>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
end if
' close the lot
objRec.Close
my_connslash.Close
set objRec = Nothing
set my_connslash = Nothing
  rsZ.close
  set rsZ = nothing


Works fine for me when I log out and use a different name but others are saying they get other members weather (zipcodes used) when loading new pages.

Can anyone who understands this stuff better help me? I am at my wits end, and I don't understand why it works for my two names and not them!

thanks you for any ideas!

gmann

Edited by - golfmann on 23 February 2006 01:24:02

golfmann
Junior Member

United States
450 Posts

Posted - 23 February 2006 :  01:24:42  Show Profile  Visit golfmann's Homepage
I know it's probably something really basic so don't laugh!
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 23 February 2006 :  04:12:33  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
I'm not sure if I fully understand... anyhow, I think the SQL statement is missing the logged on member id...:
		strSql = "SELECT ME.MEMBER_ID, ME.M_ZIP " & _
         		 "FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME " & _
        		 "WHERE ME.MEMBER_ID = " & MemberID & " AND AU.MEMBER_ID = ME.MEMBER_ID"

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 23 February 2006 :  11:40:31  Show Profile  Visit golfmann's Homepage
Looks darned reasonable to me!

I'll try it!!!

THANK YOU!!!
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 23 February 2006 :  13:05:39  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
No problem. One thing I just noticed, you'll want to handle it when the query returns no results (happens when a guest accesses the page).

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 25 February 2006 :  02:10:40  Show Profile  Visit golfmann's Homepage
Yes, I found that out the hard way...lol

Fixed it though, and thanks again!
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.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07