Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
473 views
in Technique[技术] by (71.8m points)

php - 从表中获取回显数据并插入数据库(get echo data from table and insert to database)

I have problem to get data from echo table, how to get echo from table and insert to database :

(我有问题要从回声表中获取数据,如何从表中获取回声并插入数据库:)

  1. this my html file

    (这是我的html文件)

<tr>
    <td style="width: 22%" name="item_name" value="">
        <?php echo $values["item_name"]; ?>
    </td>
    <td style="width: 10%">
        <?php echo $values["item_quantity"]; ?>
    </td>
    <td style="width: 11%">RM
        <?php echo $values["item_price"]; ?>
    </td>
    <td style="width: 15%">RM
        <?php echo number_format((int)$values["item_quantity"] * (int) 
    </td>
</tr>
  1. PHP file :

    (PHP文件:)

$item_name=$_REQUEST["item_name"];
$item_quantity=$_REQUEST["item_quantity"];
$item_price=$_REQUEST["item_price"];
$total=$_REQUEST["total"];
  {

  $query = "INSERT INTO `cart`(`item_name`,`item_quantity`,`item_price`, `total`) VALUES ('$item_name','$item_quantity','$item_price', '$total')";
      $query_run = mysqli_query($con, $query);
      echo '<script>alert("Data Cart Inserted")</script>';
      redirect("location: installment.php");
  }

How can I do that?

(我怎样才能做到这一点?)

  ask by FARIZ translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...