I'm building a form in which the quantity of rows is the number of tuples on tblTask.
Each row contains various INPUTs and a SUBMIT. Every row contains the same INPUTS.
I create the form in this manner:
Code: Select all
$iTask=1;
do {
// Other INPUTs... e.g. name="jobStatus_APPEND_TASK_NAME"
<INPUT type="submit" name="<?php echo $row_rsTask['taskName']; ?>" value="Save">
$iTask++;
} while ($row_rsTask = mysql_fetch_assoc($rsTask));
//I use $iTask to compare the tuples for initial values.
The query part:
Code: Select all
$btnClicked = "none"; // I want to set this variable to the button name
$txtStatus = 'jobStatus_'.$btnClicked; // e.g. Taskname appended to each field prefix
if ($btnClicked != "none" ){ $insertSQL ="... $_POST[$txtStatus] ...$jTask ..." }
Thanks in advance for any suggestion