goldiebugs
asked on
passing an id from a query to an a tag
<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=edi t&id=#id#" >Edit page</a></td>
</tr>
<tr>
<td>a href="send.cfm?id=#url.id# ">Apply</a ></td>
</tr>
</tr>
</table>
<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=edi
</tr>
<tr>
<td>a href="send.cfm?id=#url.id#
</tr>
</tr>
</table>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!
thank you so much. before posting this question, i tried what Wasistdas said, but that didn't work.
thank you so much!
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=edi t&id=#vali date.id#"> Edit page</a></cfoutput></td>
</tr>
<tr>
<td><cfoutput><a href="send.cfm?id=#validat e.id#">App ly</a></cf output></t d>
</tr>
</tr>
</table>
<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=edi
</tr>
<tr>
<td><cfoutput><a href="send.cfm?id=#validat
</tr>
</tr>
</table>
<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=edi
</tr>
<tr>
<td><cfoutput><a href="send.cfm?id=#validat
</tr>
</tr>
</table>