I have a problem with my web app, when I fill the form and I validate it, I didn't get anything in my phpmyadmin page! The connection is well made, but no data exported.
Here's my php code :
<?php
$connect=mysqli_connect("localhost","root","","ramsa");
if (mysqli_connect_errno()) {
echo ("Échec de la connexion : %s\n" . mysqli_connect_error());
exit();
}
$db_selected = mysqli_select_db($connect,"ramsa");
if (!$db_selected)
{
die ("Can\'t use this databse : " . mysqli_error());
}
$query = " INSERT INTO 'reservoir' (CodeReservoir, NomReservoir, AdresseReservoir, Latitude, Longtitude, Capacite, CodeRadial, Type, PseudoType, Alimentation)
VALUES ('$_POST[coderes]', '$_POST[nomres]', '$_POST[adressres]', '$_POST[latitude]', '$_POST[longitude]', '$_POST[capaciteres]', '$_POST[coteradres]', '$_POST[typeres]','$_POST[pseutype]', '$_POST[alimentationres]')";
echo "Resvoir bien ajouté.";
mysqli_query($connect,$query);
mysqli_close($connect);
?>
and here's my form's html code :
<form id="formulaire" role="form" action="send.php" method="POST">
<h3 style="color:red;">Ajouter un reservoir</h3>
<label for="coordlat" style="margin-bottom:7px;">Latitude du point</label>
<input type="text" class="form-control" id="latitude" name="latitude" placeholder="Latitude" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Longitude de point</label>
<input type="text" class="form-control" id="longitude" name="longitude" placeholder="Longitude" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Code du reservoir</label>
<input type="text" class="form-control" id="coderes" name="coderes" placeholder="Code" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Nom du reservoir</label>
<input type="text" class="form-control" id="nomres" name="nomres" placeholder="Nom" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Adress du reservoir</label>
<input type="text" class="form-control" id="adressres" name="adressres" placeholder="Adress" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Capacité du reservoir</label>
<input type="text" class="form-control" id="capaciteres" name="capaciteres" placeholder="Capacité" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Alimentation</label>
<input type="text" class="form-control" id="alimentationres" name="alimentationres" placeholder="Alimentation" style="margin-bottom:7px;" required>
<label for="coordlng" style="margin-bottom:7px;">Cote radial du reservoir</label>
<input type="text" class="form-control" id="coteradres" name="coteradres" placeholder="Cote radial" style="margin-bottom:7px;" required>
<div style="padding-top:10px;">
<select name="typeres" style="margin-bottom:7px;" required>
<option value="" disabled selected>Type du reservoir</option>
<option value="enterre">Enterré</option>
<option value="semi-enterre">Semi enterré</option>
</select>
<select name="pseutype" style="margin-bottom:7px;" required>
<option value="" disabled selected>Pseudo-type du reservoir</option>
<option value="onep">Reservoir ONEP</option>
<option value="ramsa">Reservoir RAMSA</option>
<option value="onep">Forage C</option>
<option value="onep">Forage RA</option>
</select>
</div>
<div style="padding-top:10px;">
<input type="submit" value="Valider" id="Reservoirbtn" class="btn btn-success" name="submit">
<input type="reset" value="Vider es champs" id="Reservoirbtn" class="btn btn-danger" style="margin-left:25px;">
</div>
</form>