Dati mancanti nella richiesta POST!'; return; } // Questi valori vengono letti automaticamente $host = getenv('DB_HOST'); // SarĂ  "local_db" $db = getenv('DB_NAME'); // SarĂ  "nomerepository-nomeutente" $user = getenv('DB_USER'); // Uguale al nome DB $pass = getenv('DB_PASS'); // Password generata casualmente ad ogni deploy $charset = 'utf8mb4'; $dsn = "mysql:host=$host;dbname=$db;charset=$charset"; try { $pdo = new PDO($dsn, $user, $pass); } catch (\PDOException $e) { throw new \PDOException($e->getMessage(), (int) $e->getCode()); } // Collegamento al DB effettuato, ora facciamo l'inserimento $insert = "INSERT INTO attori (nome, cognome, data_nascita) VALUES (':nome',':cognome', ':data')"; $stmt = $pdo->prepare($insert); $stmt->execute([ ':nome' => $nome, ':cognome' => $cognome, ':data' => $data_nascita ]); } ?> Aggiungi attore - The NoSpace Cinema

The NoSpace Cinema

Vedi sorgente pagina Tutti i film

Aggiungi attore

Query eseguita con successo!
"; } ?>