Good day!

I have code to check if the cloth type is NW or W for the operation name Operation3, Operation4, and Operation5.

W = all cloth that was not belong to NW

Here is the code I want to ask for you if correct and if I have missing code, because I’m not good in if condition and mysql statement.

  include 'config.php';
  $cloth_type  = $_POST['clt_type'];
  $input_qty = $_POST['input_qty'];
  $output_qty = $_POST['output_qty'];
  if ($_POST["clt_no"]){
  $query = "SELECT t.operation_name FROM clt_traceability t, clt_transact c WHERE c.cloth_type = '" .  $cloth_type . "' AND t.operation_name = 'Operation3, Operation4, Operation5 ' AND t.clt_no = c.clt_no";
  $result = mysql_query($query);
  if($cloth_type = 'AAA, BBB ,CCC')  {
    $input_qty = $input_qty * 14.15;
    $output_qty = $output_qty * 14.15;
    $input_qty = $input_qty * 15.85;
    $output_qty = $output_qty * 15.85;

And I attached the code where I want to put the code for checking the cloth type and for the automatic multiply the input qty and output qty depend on the cloth type because the user input numbers by frame so I need to multiply it to become dozen which I put in the test code above.
Thank you.
Attached Files
File Type: txt cmain20.txt (10.6 KB, 2 views)