Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dsn = 'mysql:host=localhost;dbname=adheilly';
- $username = 'adheilly';
- $password = 'tR5f62Ym';
- $dbh = new PDO($dsn, $username, $password);
- try{
- $dbh->exec("INSERT INTO `concessionnaire` (`idclient`,
- `nom`,
- `prenom`,
- `adr`
- ) VALUES (null,
- '".$_POST['nom']."',
- '".$_POST['prenom']."',
- '".$_POST['adr']."');
- ");
- } catch (PDOException $e){
- print $e->getMessage();
- }
- /*try{
- $dbh->exec("INSERT INTO `concessionnaire` (`idclient`, `nom`, `prenom`, `adr`) VALUES (NULL ,'aze','aerr','qdsf');");
- }
- catch (PDOException $e)
- {
- print $e->getMessage();
- }
- var_dump ($_POST);
- VALUES (NULL '".$_POST["nom"]."','".$_POST["prenom"]."','".$_POST["adr"]."')");*/
- <!DOCTYPE html>
- <html>
- <head>
- <title>BDD</title>
- <meta charset="UTF-8"/>
- </head>
- <body>
- <form name="BDD" method="POST" action="DataBase.php">
- Prénom : <input type="text" name="prenom" /> <br/>
- Nom : <input type="text" name="nom" /> <br/>
- Adresse : <input type="text" name="adr" /> <br/>
- <input type="submit" value="envoyer"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement