• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

How to pass 2 values using URLEncodedFormat

I want to pass 2 values called 'delOrder' and 'delOrder2' on the URL, and then delete records from a table based upon them. I'm having trouble getting the second value recognized using code along the lines of:

<!--- Code to pass the values on the URL line      --->
          <td>[ <a href="Order_Delete.cfm?delOrder=#URLEncodedFormat(ResultField1)#,delOrder2=#URLEncodedFormat(ID_Field)#" onClick="return confirm('Are you SURE you want to DELETE this record?')">DELETE</a>
              ] </td>

<!--- Code to delete the record from the database table --->
<cfquery name="deleteOrderSKUs" datasource="mparam">
DELETE FROM skialberta_Orders
WHERE SKU = '#url.delOrder#' .and. UID = '#url.delOrder2#'
</cfquery>

The error I get tells me that Cold Fusion cannot find a value for url.delOrder2, althoug you can see it being passed along in the URL. I wonder if the problem is with my ',' as the delimiter is example 1, and the '.and.' in example 2.  I've tried some variation in syntax with no luck.
0
TSellers
Asked:
TSellers
  • 2
  • 2
1 Solution
 
demarcoCommented:
a href="Order_Delete.cfm?delOrder=#URLEncodedFormat(ResultField1)#,delOrder2=#URLEncodedFormat(ID_Field)#" onClick="return confirm('Are you SURE you want to DELETE this record?')">DELETE</a>


er no mate
try

a href="Order_Delete.cfm?delOrder=#URLEncodedFormat(ResultField1)#&delOrder2=#URLEncodedFormat(ID_Field)#" onClick="return confirm('Are you SURE you want to DELETE this record?')">DELETE</a>


you need to use & not , to concernate the url
0
 
TSellersAuthor Commented:
Thanks demarco, that should do it. BTW, the statement: WHERE SKU = '#url.delOrder#' .and. UID = '#url.delOrder2#'

Is the syntax on that look OK?

Thanks again.
0
 
demarcoCommented:

cfquery name="deleteOrderSKUs" datasource="mparam">
DELETE FROM skialberta_Orders
WHERE SKU = '#url.delOrder#' .and. UID = '#url.delOrder2#'



remove the .'s from and I would think :)

cfquery name="deleteOrderSKUs" datasource="mparam">
DELETE FROM skialberta_Orders
WHERE SKU = '#url.delOrder#'
AND UID = '#url.delOrder2#'


if thats trowing errors remove the ' ' form he vars
esp if the vars are numeric and the db is access :)
0
 
TSellersAuthor Commented:
demarco, thanks,

I took the '.' away and that seemed to do the trick so I'm up and running now, thanks again.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now