0
ola i have this form that multiplies according to the app registration for the user,
.
see the result graphically,
how do I enter into the database where I can have a user with up to 7 distinct record or more? I am currently doing half q manual but with records q was not to be inserted
session_start();
if (!isset($_SESSION['login']) || $_SESSION['nivel_acesso_id'] != '2') { //verifica se existe um usuario logado.
}
$conn = new mysqli("localhost", "root", "", "teste");
$brf1 = $_POST['brf1'];
$brf2 = $_POST['brf2'];
$brf3 = $_POST['brf3'];
$brf4 = $_POST['brf4'];
$brf5 = $_POST['brf5'];
$brf6 = $_POST['brf6'];
$brf7 = $_POST['brf7'];
$app1 = '1';
$app2 = '2';
$app3 = '3';
$app4 = '4';
$app5 = '5';
$app6 = '6';
$app7 = '7';
$iduser = $_SESSION['id'];
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO events (id_nome, brfinal, aplicativo)
VALUES ('$iduser', '$brf1', '$app1');";
$sql .= "INSERT INTO events (id_nome, brfinal, aplicativo)
VALUES ('$iduser', '$brf2', '$app2');";
$sql .= "INSERT INTO events (id_nome, brfinal, aplicativo)
VALUES ('$iduser', '$brf3', '$app3')";
$sql .= "INSERT INTO events (id_nome, brfinal, aplicativo)
VALUES ('$iduser', '$brf4', '$app4')";
$sql .= "INSERT INTO events (id_nome, brfinal, aplicativo)
VALUES ('$iduser', '$brf5', '$app5')";
$sql .= "INSERT INTO events (id_nome, brfinal, aplicativo)
VALUES ('$iduser', '$brf6', '$app6')";
if ($conn->multi_query($sql) === TRUE) {
echo "<script>alert('Preencha todos os campos para logar-s333e.'); history.back();</script>";
header("Location: calendar.php");
} else {
echo "<script>alert('Preencha todos os campos para logar-s111e.'); history.back();</script>" . $conn->error;
}
$conn->close();
?>
Passes a
JSON
containing arrays containing data from<forms>
.– Augusto Vasques
First of all, avoid using images for codes, because if we’re going to do something to help, we’re not going to type what you could have typed here for us. Second I need to know how you send the data to PHP, through the standard Submit
<form>
or using JS?– Wees Smith
ok sorry but everything for me here is new but with respect to Submit is the form pattern
– dhionatan