the code is only part of my code where i encounter problem and the code that i post is if the plt_no did not exist the form will appear.
And the form was appear, the code doing now is the last operation name the 04 Oper was duplicated in the database but only the operation name
and the rest data was blank.
The second doing of my code is on the last text box for date after I insert date and I pressed enter key instead of the cursor was go to the shift
textbox it goes to the save button so I have no chance to insert data in shift textbox.
On my first problem I tried to debug and i think the problem is from this code:
$query = "SELECT t. operation_name, t. input_unit, t. output_unit FROM trace_operations t
WHERE t. plt_typeno = '" . $_POST["plt_typeno"] . "'
AND t. operation_name IN('02 Oper','03 Oper','04 Oper') ORDER BY t. operation_name";
$last_operation_name = "";
$result = mysql_query($query);
$totalrows = mysql_num_rows($result);
$trows = $totalrows - 1;
for($ctr = 0; $ctr < $trows; $ctr++)
$row = mysql_fetch_array($result);
$tctr = $ctr + 1;
I tried to edit it but nothing was change. Honestly, i'm not good in coding specially in condition statement.
On my second problem I have no idea why does after I press enter key the save button was press.