|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Passing Information in Query
I created a query with a list of names and when i click on one of the names i should be accesed with a new page that would display that person information.. i don't know how to pass the information. do i have to use paramaters? if so, how?
|
|
#2
|
|||
|
|||
|
the list link may look like this
somefile.cfm --- <a href='newpage.cfm?name_id=1'>One of your name list</a> then create the sql query on ur new page with following eg. URL.name_id example: newpage.cfm --- <cfquery name='getInfo' datasource='yourdsn'> select * from your_table_name where name_id = '#URL.name_id#' </cfquery> <cfif getInfo.RecordCount gt 0> <cfoutput query='getInfo'> #TheName#<br/> #TheAddress#<br/> #PhoneNum#<br/> </cfoutput> <cfelse> Sorry no person infomation reffer from ur id request </cfif>
__________________
Making it different not a profit |
|
#3
|
|||
|
|||
|
You want to pass the values in a URL (or in the form action if you are using a form). An example:
http://mysite.com/index.cfm?myvariable=10 Passes a variable called URL.myVariable to the target page with a value of 10. This sort of thing is covered in the first few chapters of any ColdFusion book and is extremely fundamental to using ColdFusion. If you're having questions on topics like this I would *strongly* urge you to buy a book and go through the examples.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
Thanks alot.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Passing Information in Query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|