I'm creating a website and i want to insert data into a phpmyadmin table from a form (method="post") it didn't work i'm connected to the data base but when i type stuff in my form it's not inserted in the table, here's my php part:
<?php
$hostname = 'localhost';
$username = 'root';
$password = '';
try {
$conn = new PDO("mysql:host=$hostname;dbname=Database", $username, $password);
echo 'Connected to database';
}
catch(PDOException $e)
{
echo $e->getMessage();
}
$nom = $_POST['nom'];
$prenom =$_POST['prenom'];
$email = $_POST['email'];
$password = $_POST['password'];
$type = $_POST['type'];
$sql = "INSERT INTO client (nom, prenom, email,password,type)
VALUES ($nom, $prenom, $email, $password , $type)";
}
$conn->connection = null;
?>