0
Well, the title itself is self-explanatory. Perhaps the only relevant detail I can add, is the fact that when performing the operation I get no error, nor Warning.
Thank you in advance for your answers.
<?php
if($_POST){
///conexao
$con = mysqli_connect('localhost', 'root','','SocialNetwork');
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
///variaveis
$name = $_POST['name'];
$description = $_POST['description'];
$maxguest = $_POST['maxguest'];
$currentguest = $_POST['currentguest'];
$address = $_POST['address'];
$privacy = $_POST['privacy'];
///insercao dos elementos no banco de dados
$query = "INSERT INTO `events`(`name`, `description`, `maxguest`, `currentguest`, `address`, `privacy`) VALUES ('$name', '$description', '$maxguest', '$currentguest', '$address', '$privacy')";
mysqli_query($con,$query or die(msqli_error($con)));
}
?>
<h1>New event</h1>
<form class="form" action="newEvent.php" method="post" enctype="multipart/form-data" autocomplete="off"><br><br>
<input type="text" name="name" value="" placeholder="partys name" required /><br><br>
<input type="text" name="description" value="" placeholder="description" required /><br><br>
<input type="number" name="maxguest" value="" placeholder="guests limit" required /><br><br>
<input type="number" name="currentguest" value="" placeholder="current guests" required /><br><br>
<input type="text" name="address" value="" placeholder="address" required /><br><br>
<input type="radio" name="privacy" value=0 checked>Public<br><br>
<input type="radio" name="privacy" value=1>Private<br><br>
<input type="submit" name="newParty" value="new party!"/>
</form>
mark as answer accepted
– user60252