Salve ragazzi,
è poco che mi cimento con php,
non so dove sbaglio, non aggiunge la riga alla tabella
i file sono in htdocs di xampp,
apache è avviato
potete aiutarmi,
Grazie
questo è il form
Inserisci Nuovo Utente
Email ___________
Nome __________
inserisci
<?php
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
die('You cannot access to the page');
}
$user = 'root';
$password = 'miaPassword';
$db = 'C:\xampp\mysql\data\romaestre';
$host = 'localhost';
$port = 500;
$conn = new PDO("mysql:host=$host; dbname=$db; port=$port", $user, $password);
$errors = [];
$email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
$Name = filter_var($_POST['nome'], FILTER_SANITIZE_STRING);
$db->query("INSERT INTO email(email, nome) VALUES($email,$Name)");
?>