I have a table with a text id and a value. I want to allow users to update all rows at once. I need to use an array, but I need to know the key and the new value. How do I create the array with a specified key and then loop thru the array.
Here is the textbox declaration:
<input type=\"text\" name=\"select[\"" . $dbcnx->f("mylabel_hdr_id") . "\"]\" value=\"\" size=\"50\" maxlength=\"50\">
Here is the code to loop thru:
for ($i=0; $i < count($select); $i++)
{
echo array_keys($select, $i) . " - " . $select[$i] . "<br>";
$sql = "INSERT INTO frm_label_dtl (label_hdr_id, language_id, label)
VALUES (" . array_keys($select, $i) . ", '$language_id', '$select[$i]')";
echo $sql . "<br>";
$dbcnx->query($sql);
}
Forgive me if this question has been answered before...I couldn't find it.
TIA,
Crystal