velwind
Постоялец
- Регистрация
- 25 Май 2018
- Сообщения
- 52
- Реакции
- 22
Теперь стало ясноВот скрин
PHP:
<?php
// Database Server (localhost)
define("DBHOST","localhost");
// Database Username
define("DBUSER","root");
// Database Password
define("DBPASS","");
// Database Name
define("DBNAME","test");
# Location Infomation
// Create database connection
$connect = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);
if ($connect ->connect_error) {
die("Connection failed: " . $connect ->connect_error);
}
var_dump($_POST);
$statement = $connect->prepare("INSERT INTO tbl_order_items(order_id, item_name, item_quantity, item_unit) VALUES (?,?,?,?)");
for ($count = 0, $c = count($_POST["item_name"]); $count < $c; $count++)
{
$order_id = uniqid();
$statement->bind_param("siis",
$order_id,
$_POST["item_name"][$count],
$_POST["item_quantity"][$count],
$_POST["item_unit"][$count]);
$statement->execute();
var_dump($stmt->affected_rows);
}
Такое в insert.php положить