I'm struggling to send multiple records of user to my mysql databse. I'm trying to create a small registration app where users pick events and how many people they want to register on it.
Then i return specific number of registration forms depending on the users pick. Next i want send all this data to my table.
Here is my code so far
if (isset($_POST['submit'])) {
$persons = $_POST['person_number'];
$event = $_POST['event'];
for ($i=1; $i <= $persons; $i++) {
echo "<b>Uczestnik #" . $i;
$content = "<form action='thankyou.php' method='post' />";
$content .= "<div class='form-group'>
<label for='Imię'>Imię</label>
<input type='text' class='form-control' name='name' />
</div>";
$content .= "<div class='form-group'>
<label for='Nazwisko'>Nazwisko</label>
<input type='text' class='form-control' name='last-name' />
</div>";
$content .= "<div class='form-group'>
<label for='email'>Adres Email</label>
<input type='email' class='form-control' name='email' />
</div>";
echo $content;
}
echo "<button type='submit' class='btn btn-primary' name='submit2>Rejsestruje się</button>";
echo "</form>";
}
?>
Also i have another question ,since my users pick few events i store their pick and array and later on post it to form page. How can i separate it and give as input to table query so for example 10 users could go to room a and 20 to room b ?
<input type="checkbox" class="ck" name="event[]" id="event" value="<?php echo $row['name'];?>"><span>Wybierz</span>
Thank you fo much for all your support