|
| |
|
|
colnixon
Posts: 5 Joined: 8/18/2009 Status: offline
|
Using Sessions in Database Results Wizard - 8/18/2009 20:09:46
Hi All, Got a little problem thats costing me a lot of time researching, can anyone help... I read in a Session variable and call it userID I then need to select record from a table based on the session.userID using frontpage DRW I have seen a previous post saying SELECT * FROM tblUsers WHERE ID = '" &session("userID")& "' ID is the fieldname in the database table, the above gives me a datatype mismatch so i tried the following: SELECT * FROM tblUsers WHERE ID = '" &session(::userID::)& "' With the above i get the following error: "One or more form fields were empty" Any ideas anyone please? Thanks in Advance Col
|
|
|
|
BeTheBall
Posts: 6493 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Using Sessions in Database Results Wizard - 8/18/2009 22:59:18
Try your first example but without the single quotes, i.e., SELECT * FROM tblUsers WHERE ID = " &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.
|
|
|
|
colnixon
Posts: 5 Joined: 8/18/2009 Status: offline
|
RE: Using Sessions in Database Results Wizard - 8/19/2009 19:11:30
Hi, Many Thanks for help given so far. I have noticed that the script I have downloaded is not actually using "userID" as a session variable, instead it is using "userName" which is a string field. I have tried using the code you have given and the DRW given me an error. I have tried using both custom query in this thread in my DRW and then click ok and I get the error saying "The server encounted an error whilst trying to process a database request" I have tried adapting the code to the following Select * From Active_Users Where User_ID = '" &session("userName") "' This work but on the results page it say no records are found? Any Ideas Guys??? Thanks Again Col
|
|
|
|
colnixon
Posts: 5 Joined: 8/18/2009 Status: offline
|
RE: Using Sessions in Database Results Wizard - 8/20/2009 21:11:47
quote:
Hi, Many Thanks for help given so far. I have noticed that the script I have downloaded is not actually using "userID" as a session variable, instead it is using "userName" which is a string field. I have tried using the code you have given and the DRW given me an error. I have tried using both custom query in this thread in my DRW and then click ok and I get the error saying "The server encounted an error whilst trying to process a database request" I have tried adapting the code to the following Select * From Active_Users Where User_ID = '" &session("userName") "' This work but on the results page it say no records are found? Any Ideas Guys??? Thanks Again Col
|
|
|
|
colnixon
Posts: 5 Joined: 8/18/2009 Status: offline
|
RE: Using Sessions in Database Results Wizard - 8/24/2009 19:06:34
quote:
'" &session("userName") "' Hi So0ky, Thanks again for the great advice. My database results wizard accepts the code you provided but I am left with one last thing that aint working correctly. After logging in the user is taken to a page where the DRW produces records based on the customers username. Everytime it comes back saying no records found... I have since obtained a much simpler login script to try and understand why I am getting no records and i found i had the same problems here as well. All the database fields match up properly, I dont think the session variable is been read in before my DRW. Any Ideas Thanks Col
|
|
|
|
colnixon
Posts: 5 Joined: 8/18/2009 Status: offline
|
RE: Using Sessions in Database Results Wizard - 8/31/2009 15:00:36
I have now found that the session variable has been created ok because the page redirects if the session varUsername = "" Select * From tblUsers Where username = ' " &session("varUsername") &" ' I have bunched the quotes up as well to no effect Any ideas why i keep getting "no records found" Many Thanks Col
|
|
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
|
|
|