fusionaire
Programmer
I have a shopping cart application in which I pass variable values through URL's. The problem is, if someone selects the same product again, it will show up twice on the "items selected" screen. When the user goes to eliminate one of the two already selected products, information on both are deleted from the database.<br><br>So, I have tried to come up with a way to uniquely identify an already inserted product in the database.Here is the code for that:<br><br><CFQUERY name="prod" datasource="wpslive"><br>SELECT PRODUCT_ID, ORDERNUMBER AS REDUNDANTITEM<br>FROM orders<br>WHERE ORDERNUMBER='#session.cid#'<br></cfquery><br><br><cfoutput query="prod"><br><input type="hidden" name="REDUNDANTITEM" value="#prod.REDUNDANTITEM#"><br></cfoutput><br><br> <br><CFIF IsDefined ("prod.REDUNDANTITEM"
><br><br><CFLOCATION URL ="alreadyordered.cfm" ADDTOKEN="no"><br></cfif><br><br>When I use this code, anytime I select any product, the CFLOCATION kicks in and the user is told that they have already entered the chosen product already. <br><br>If anyone knows a better way to do this, I'd very much appreciate it.<br><br>PS~Special thanks to Darkman, who seems to know the answer to everything!