I want the user to add products into the order table but I
don't want it to add the same product two or more times into
the table.
I made a condition and for a test I used ProductID s and I
put them in the condition myself just to test it.
If I enter the same productID which is in the
Hi:
I want the user to add products into the order table but I don't want it to
add the same product two or more times into the table.
I made a condition and for a test I used ProductID s and I put them in the
condition myself just to test it.
If I enter the same productID which is in the table it
A more efficient way would be (provided you're using enterprise-grade DBMS):
cfquery datasource=test_shop
if not exists
(SELECT *
FROM orders
WHERE PRODUCTID = {cfqueryparam...})
begin
INSERT INTO orders (productID)
VALUES ({cfqueryparam...})
end
3 matches
Mail list logo