OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Using Sessions in Database Results Wizard

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Using Sessions in Database Results Wizard
Page: [1]
 
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.

(in reply to colnixon)
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Using Sessions in Database Results Wizard - 8/19/2009 18:11:51   
Dont worry about the last bit ;-)

SELECT * FROM tblUsers WHERE ID = " &session("userID")

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to BeTheBall)
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

(in reply to Spooky)
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

(in reply to Spooky)
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Using Sessions in Database Results Wizard - 8/21/2009 3:04:01   
quote:

Select * From Active_Users Where User_ID = ' " &session("userName") &" ' "


LIke so - note the space between the quotes is only for clarity

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to colnixon)
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

(in reply to Spooky)
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

(in reply to colnixon)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Using Sessions in Database Results Wizard
Page: [1]
Jump to: 1





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