|
| |
|
|
winter
Posts: 168 Joined: 3/12/2002 From: Toronto ON Canada Status: offline
|
How to Show AccountExpires - 5/4/2008 18:52:14
Hi – using FP2003 + the Dev Version of the Spooky Login System, I am trying to set up a page where users can view their other account records associated with the login system. The page is password protected. I have been able to show the session variable for x_FirstName, X_Lastname etc. but the one that just won’t work is a session variable that would show when the account is expired. I am using this bit of code: <%=Session("AccountExpires")%> In the admin panel for the login, each member record expirary date is set manually. It’s not linked to a pay pal feature. I tried using the DRW with the login db, and the Spooky Diet, adding: fp_sQry="SELECT * FROM Users WHERE (UserID='"&Session("UserID")&"')" ,,, and selecting “accountexpires” for a result, but only get a DRW error. Am I missing something or is it more complicated than this? Help would be very appreciated!
_____________________________
" All that matters is what we do for each other" Lewis Carroll
|
|
|
|
winter
Posts: 168 Joined: 3/12/2002 From: Toronto ON Canada Status: offline
|
RE: How to Show AccountExpires - 5/4/2008 23:26:14
Hi Spooky - thanks so much for helping! Here is the DRW code - which i am not sure where the delimiters go. <!--#include file="../_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT * FROM Users WHERE (UserID='"&Session("UserID")&"')" fp_sDefault="" fp_sNoRecords="<tr><td colspan=2 align=""LEFT"" width=""100%"">No records returned.</td></tr>" fp_sDataConn="HRALogin" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_sColTypes="&UserID=3&x_Firstname=202...the usual thing in here fp_iDisplayCols=2 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <!--#include file="../_fpclass/fpdbrgn1.inc"--> <tr> <td> <%=FP_FieldVal(fp_rs,"ActiveAccount")%></td> <td> <%=FP_FieldVal(fp_rs,"AccountExpires")%></td> </tr> <!--#include file="../_fpclass/fpdbrgn2.inc"--> </tbody> </table> <p> </p> <p> </div> This is the error message That I get: ActiveAccount AccountExpires Database Results Wizard Error The operation failed. If this continues, please contact your server administrator. Do you mean to put the ' or # somewhere in this part of the code?... <%=FP_FieldVal(fp_rs,"AccountExpires")%> I will play with this. Thanks so much! Carolyn
< Message edited by winter -- 5/4/2008 23:44:15 >
_____________________________
" All that matters is what we do for each other" Lewis Carroll
|
|
|
|
winter
Posts: 168 Joined: 3/12/2002 From: Toronto ON Canada Status: offline
|
RE: How to Show AccountExpires - 5/4/2008 23:43:05
quote:
<%=FP_FieldVal(fp_rs,"ActiveAccount")%> For the DRW code in the last post I tried amending the "Account Active" part this way... <%=FP_FieldVal(fp_rs,'"AccountExpires"')%> <%=FP_FieldVal(fp_rs,#"AccountExpires"#)%> .. and I also tried putting the delimiters outside the brackets but i still get the error message. hmmm... will sleep on this. Other ideas very welcomed! Thanks again. Carolyn
_____________________________
" All that matters is what we do for each other" Lewis Carroll
|
|
|
|
BeTheBall
Posts: 6271 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: How to Show AccountExpires - 5/5/2008 10:23:35
The single quotes shouldn't be there. Response.Write(FP_FieldVal(fp_rs,"AccountExpires"))
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
winter
Posts: 168 Joined: 3/12/2002 From: Toronto ON Canada Status: offline
|
RE: How to Show AccountExpires - 5/5/2008 19:42:48
Thanks Duane and Spooky, I originally started out with just double quotes, then added single, now removed the single quotes. I tried it out again on a fresh page with just this DRW and the code you have suggested which actually does get generated by the wizard. Here is the sample page I am using with the newest error message: http://www.hramembers.org/test55.asp And where this code appears in the DRW: <%=FP_FieldVal(fp_rs,"AccountExpires")%> U/p: test/test Do I need to switch something on for this variable in the system settings somewhere? Ideas very appreciated! Thanks Carolyn
|
|
|
|
BeTheBall
Posts: 6271 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: How to Show AccountExpires - 5/5/2008 19:54:14
Lose the single quotes in your SQL. I assume UserID is numeric. If so, this: SELECT * FROM Users WHERE (UserID='"&Session("UserID")&"') should be: SELECT * FROM Users WHERE (UserID="&Session("UserID")&")
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
winter
Posts: 168 Joined: 3/12/2002 From: Toronto ON Canada Status: offline
|
RE: How to Show AccountExpires - 5/5/2008 20:37:00
Hi Duane, - I tried the code you suggested: quote:
SELECT * FROM Users WHERE (UserID="&Session("UserID")&") ... and still doesn't work as seen on the page http://www.hramembers.org/test55.asp However, if I leave the sql statement alone, and use the DRW for the AccountExpires piece as on this page: http://www.hramembers.org/membership/myaccount2.asp ... you are able to access the page and all the other session variables show up, but the DRW for "AccountExpires" does not work. Scroll way down to the very bottom of the page where i was trying to test it. the slq statement is with the double and single quotes. In the system settings, Access level values are recorded the same as the name of the level i.e. Certifed has a stored value of Certified. I may have done this when My knowledge of the Spooky Login system was at a grade 6 level as opposed to perhaps grade 9 or so now! Could this be the problem? Thanks so much - I really appreciate your help!
|
|
|
|
winter
Posts: 168 Joined: 3/12/2002 From: Toronto ON Canada Status: offline
|
RE: How to Show AccountExpires - 5/5/2008 20:54:05
quote:
fp_sQry="SELECT * FROM Users WHERE UserID="&Session("UserID") I can't stop smiling! It works!!!!! Not only that... for a few seconds I was wondering ...well... why does it work? Spooky from your earlier suggestion, I am concluding the a single quote + double quote in the sql statment, means that it is putting a separator in between 2 or more things? IF that is the answer, - I think I really get it. My thanks to both of you! This is wonderful! It works! With appreciation Carolyn
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|