Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Problem in Duplication of data and onenter key

newphpcodernewphpcoder Posts: 21Member
Good day!


I have 2 problems with my code 1st is in the last operation name or the 04 Oper it was duplicate but the duplicate was only the operation name and the rest data was blank . I tried to debug it but I ca'n find where is wrong in my syntax. And the 2nd problem is for the enter key function or array, because my textbox I used array, and to move on the next textbox i used enter key, the problem is on the last date when i press enter key instead of move the cursor on the shift textbox it was save. I want to happen is after the last date and I press enter key the cursor was on the shift textbox then after i input data in shift and i press enter key it will save.


Here is my code:


[PHP]
<?php
if($rexist == 0)
{
$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);
if($result){
$totalrows = mysql_num_rows($result);
$trows = $totalrows - 1;
for($ctr = 0; $ctr < $trows; $ctr++)
{
$row = mysql_fetch_array($result);
$tctr = $ctr + 1;
echo "
<tr>";
echo "
";
if ($last_operation_name != $row["operation_name"]) echo $row["operation_name"];
$last_operation_name = $row["operation_name"];
echo "";
echo "
";
echo "
";
echo "
";
echo "
" . $row["input_unit"];
echo "";
echo "
";
echo "
" . $row["output_unit"];
echo "";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
}
if($totalrows > 1);
{
$row = mysql_fetch_array($result);
echo "
";
echo "
";
if ($last_operation_name != $row["operation_name"]) echo $row["operation_name"];
$last_operation_name = $row["operation_name"];
echo "";
echo "";
echo "
";
echo "
";
echo "
";
echo "
" . $row["input_unit"];
echo "";
echo "
";
echo "
" . $row["output_unit"];
echo "";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
}
echo "";
echo "

";
echo "";
}
}
?>
[/PHP]


Any help is highly appreciated..

Thank you very much.. Ask me a question if my problem did not clear with you.:confused:


Again, Thank you so much
Sign In or Register to comment.