Link to home
Start Free TrialLog in
Avatar of aka_FATCAT
aka_FATCAT

asked on

Update one or more rows in one step.

First page queries the database for open invoices, the user selects one or more invoices and presses submit.

The second page displays the invoice numbers and the total for all invoices selected.

The user then selects the payment form and submits.

Im having trouble figuring out how to update the invoice status to paid.

UPDATE invoice
SET invoice_status = '1'
SET balance = '0'
WHERE inv_id = '#FORM.invoice_id#'

How can i make it loop through all the selected invoices and update them all.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of js_vaughan
js_vaughan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aka_FATCAT
aka_FATCAT

ASKER

I can't us cfdump on my shared hosting account.
i had it there for testing, the line is not needed.  sorry for the confusion
That sort of works.

The problem is that the form is on one page that when submitted displays the information on a conformation page. The user then chooses the payment method and submits the form.

So I will need to store the invoice_id's somewhere for it to be used when the second form is submitted.

Thanks
put a hidden formfield on your confirmation page.
<input type="hidden" name="invoice_id" value="#FORM.invoice_id#" />

Open in new window

Ahhh, my level of ignorance has been upgraded to master level.

Thank you.
Simply elegant.