I want to display the datas inserted by the user to be saved into 2 tables in the database. But this code is not working for me.
$query = "INSERT INTO partnumber (Partnumber, Description, Min, Max) VALUES
('" . $_POST ["part"] . "', '" . $_POST["description"] . "', '" . $_POST["min"] . "', '" . ($_POST["max"]) . "')INSERT INTO forecast (Partnumber, Min, Max) VALUES
('". $_POST ["part"] . "', '" . $_POST["min"] . "','" . ($_POST["max"]) . "')";
$result = $db_handle->insertQuery($query);
if(!empty($result)) {
$error_message = "";
$success_message = "Saved successfully!";
unset($_POST);
} else {
$error_message = "Problem in saving. Try Again!";
}
$sql = "INSERT INTO forecast (Partnumber, Min, Max) VALUES
('". $_POST ["part"] . "', '" . $_POST["min"] . "','" . ($_POST["max"]) . "')";
$result = $db_handle->insertQuery($sql);
if(!empty($result)) {
$error_message = "";
$success_message = "Saved successfully!";
} else {
$error_message = "Problem in saving. Try again!";
}
The error was
Invalid query
Can someone help?