?
Solved

passing an id from a query to an a tag

Posted on 2003-03-18
4
Medium Priority
?
154 Views
Last Modified: 2013-12-24
<cfif '#form.email#' is not ''>
<cfquery name="validate" datasource="#dsn#">
SELECT           *
FROM           tablename
WHERE           email = '#form.email#'
AND          password = '#form.password#'
</cfquery>

<!--- i want to take the id from the table and use it in the a tag below for edit. how can i do this? --->

<table width="300" align="center" border="0" cellpadding="1" cellspacing="1">
 <tr>
  <td>a href="editpage.cfm?act=edit&id=#id#">Edit page</a></td>
 </tr>
 <tr>
  <td>a href="send.cfm?id=#url.id#">Apply</a></td>
 </tr>
 </tr>
</table>
0
Comment
Question by:goldiebugs
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Wasistdas
ID: 8163330

<cfif '#form.email#' is not ''>
<cfquery name="validate" datasource="#dsn#">
SELECT           *
FROM           tablename
WHERE           email = '#form.email#'
AND          password = '#form.password#'
</cfquery>

<!--- i want to take the id from the table and use it in the a tag below for edit. how can i do this? --->

<table width="300" align="center" border="0" cellpadding="1" cellspacing="1">
<tr>
 <td><cfoutput><a href="editpage.cfm?act=edit&id=#validate.id#">Edit page</a><cfoutput></td>
</tr>
<tr>
 <td><cfoutput><a href="send.cfm?id=#validate.id#">Apply</a><cfoutput></td>
</tr>
</tr>
</table>
0
 
LVL 6

Accepted Solution

by:
dash420 earned 200 total points
ID: 8164121
<cfif '#form.email#' is not ''>
<cfquery name="validate" datasource="#dsn#">
SELECT           *
FROM           tablename
WHERE           email = '#form.email#'
AND          password = '#form.password#'
</cfquery>

<!--- i want to take the id from the table and use it in the a tag below for edit. how can i do this? --->
<cfoutput query="validate">
<table width="300" align="center" border="0" cellpadding="1" cellspacing="1">
<tr>
 <td>a href="editpage.cfm?act=edit&id=#id#">Edit page</a></td>
</tr>
<tr>
 <td>a href="send.cfm?id=#id#">Apply</a></td>
</tr>
</tr>
</table>
</cfoutput>
0
 

Author Comment

by:goldiebugs
ID: 8168136
oh my - why didn't i think of that?

thank you so much. before posting this question, i tried what Wasistdas said, but that didn't work.

thank you so much!
0
 
LVL 1

Expert Comment

by:Wasistdas
ID: 8168733
I just forgot to slash <cfoutput>. The correct code is:

<cfif '#form.email#' is not ''>
<cfquery name="validate" datasource="#dsn#">
SELECT           *
FROM           tablename
WHERE           email = '#form.email#'
AND          password = '#form.password#'
</cfquery>

<!--- i want to take the id from the table and use it in the a tag below for edit. how can i do this? --->

<table width="300" align="center" border="0" cellpadding="1" cellspacing="1">
<tr>
<td><cfoutput><a href="editpage.cfm?act=edit&id=#validate.id#">Edit page</a></cfoutput></td>
</tr>
<tr>
<td><cfoutput><a href="send.cfm?id=#validate.id#">Apply</a></cfoutput></td>
</tr>
</tr>
</table>

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question