I am deleting data chosed from radio buttons,
it is working right, deleting the choosed value,
but display the wrong description of the deleted value.
It always get the last $_POST[description] value, from the form where i choose the data to be deleted, instead of the real deleted value.
Here is the code where i choose the data to be deleted:
<?php
$cmdstr = "SELECT CODE, DESC FROM TABLE ORDER BY CODE ASC";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
for ($i = 0; $i < $nrows; $i++ ) {
echo "<TR><TD><input type=\"radio\" name=\"CODE\" value=\"". $results
[$i] ."\"></TD><TD>";
echo $results[CODE][$i] ;
echo "</TD><TD>";
//Here i supose i could passs the description from
//the marked radio button
echo "<input type=\"text\" name=\"DESC\" value=\"". $results[DESC] [$i] ."\">";
echo "</TD></TR>";
}
OCILogoff($db_conn);
?>
And here is the final code:
<?php
$sql = "DELETE FROM TABLE WHERE CODE='$_POST[CODE]'";
$sql = ociparse($db_conn, $sql) or die("ERROR");
ociexecute($sql);
echo "<b>Data deleted !!</b>
<table><tr><td>Code</td><td>". $_POST['CODE'] ."</td></tr>
<tr><td>Description</td><td>". $_POST['DESC'] ."</tr></table>"; //it shows the wrong description
OCILogoff ($db_conn); */
?>