Accessing CFQUERY results attribute on subsequent pages.

I am using Dreamweaver / CF8. I am INSERTING a new entry into a database. I am successful, and I am getting a cfdump of the userID via

<cfdump var="#result.IDENTITYCOL#" />

BUT NOW HOW DO I PASS the value of result.IDENTITYCOL to the next page?

I want to use it as part of my SQL query to pull the record up using the userID.

I tried setting result.IDENTITYCOL  as a session variable, but apparently I'm doing it wrong, because it is giving me error messages.

your help is greatly appreciated.
TomEnokRAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PluckaCommented:
Depends how you are navigating to the next page.

You can put it in the url or a session variable.

Normally the url

nextpage.cfm?recordId=#result.identitycol#
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TomEnokRAuthor Commented:
How do I set it up as a session variable?

on my second page, i did this:

<cfset Session.sessUserID = #result.IDENTITYCOL#>


Then I tried to access sessionUserID in a form, and it says that result.IDENTITYCOL is undefined.

0
TomEnokRAuthor Commented:
Okay..I got it working via the URL. my problem was that I moving to the second form on submit...rather than after insertion.... so it was causing me to pass a null variable, as it was not yet defined. All is well. Your URL solution works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.