Forum Moderators: coopster

Message Too Old, No Replies

Updating Database Using Oracle

         

Wiecha

8:06 pm on Sep 13, 2004 (gmt 0)



This is somewhat a complex issue for me to handle. Any help is greatly appreciated. I am using PHP, with an ORACLE connection. A database filled with user name, error message, and annotation field is queried and displayed in a table. Each Row of the table contains a check box. The annotation value appears in a text box, so that the user can modify its value. If they change this value via the text box, and the associated rows check box is selected, then it is to update the database for the new user entered annotation.

I am unsure how to verify, if they select 3 check boxes, modify the corresponding rows annotation field, how to update this in the database? I am pretty confused on this issue. So how can i verify which box is checked, to obtain the user entered value for that row that is checked, then update the database with the newly entered text box value.

Please Help
Thanks.

Timotheos

3:40 pm on Sep 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Wiecha and welcome to WebmasterWorld,

I know nothing about Oracle but here's an example of what I do with checkboxes

<input type="checkbox" name="assign[<?php echo $unique_id?>]" value="Yes">

The idea is to get the user's unique id to make an array so it ends up something like

<input type="checkbox" name="assign[1]" value="Yes">
<input type="checkbox" name="assign[2]" value="Yes">
<input type="checkbox" name="assign[3]" value="Yes">

You'd make other fields with the same unique id key assignment.

Now when the form is posted you can grab the arrays
$assign = $_POST['assign'];
and do with it what you will.

The handiest thing is to use a foreach so you can grab the keys and use them in your logic.
foreach ($assign as $unique_id => $value) {
//update database based on $unique_id and it's associated $value
}

Maybe somebody else has a cleaner method but this works for me when building large tables that are editable.

Tim