Aaron Koning wrote:
Owen makes a good point. Check that you are using the [] in the HTML input
variable for the checkboxes. Like:

<input type="checkbox" name="approved[]" value="1" /> 1 <br/>
<input type="checkbox" name="approved[]" value="2" /> 2 <br/>
<input type="checkbox" name="approved[]" value="3" /> 3 <br/>
<input type="checkbox" name="approved[]" value="4" /> 4 <br/>

Aaron

On 12/13/05, Owen Jacobson <[EMAIL PROTECTED]> wr
I'm not familiar with Cocoon, but I'd expect that to return only the first
of the "approved" values from the HTTP request.  If you add logging to the
stored function (RAISE NOTICE 'approved: %', approved; near the start of the
function, for instance) and tell PostgreSQL to store the logs, you can see
what values your function is actually being called with.

What you really want to do is begin a transaction, loop over all the
values of approved present in the form data and call (the rewritten version
of) update_messages for each one, then commit the transaction.

-Owen

Thank you all, so much, for taking the time to help me out. Especially as a beginner, where coding IS rocket science.

On the general board, Aaron mentioned:

UPDATE message_table SET status = 'A' WHERE mid IN (1,2,3);

which seems very succinct and economical. I'm gonna have a go at parsing the 
query string using XSLT, substituting the variable for:

UPDATE message_table SET status = 'A' WHERE mid IN ($query_values_here);

Again, thanks for the help,

Daniel



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to