Insertion de données dans une bd mysql
Bonjour j'ai un problème pour insérer des données dans ma base mysql à partir d'un formulaire et d'un script : svp, qq'un pourrait-il m'aider ?
VOICI LES DEUX CODEX
LE FORMULAIRE
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form method="POST" action="AjouterResultat.php"enctype="multipart/form-data">
<table>
<tr>
<td>RESULTAT:</td>
<td><input type="text" name ="RESULTAT"></td>
</tr>
<tr>
<td>ACTIVITES:</td>
<td><input type="text" name="ACTIVITES"></td>
</tr>
<tr>
<td>SOUSACTIVITES:</td>
<td><input type="text" name="SOUSACTIVITES"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Enregistrer"></td>
</tr>
</table>
</form>
</body>
</html> |
ET LE SCRIPT
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?php
$conn=mysqli_connect(
"Localhost",
"root",
"",
"pta_dga") or die(mysqli_connect_error());
mysqli_select_db($conn,"pta_dga") or (die(mysqli_connect_error()));
$RESULTAT=$_POST['RESULTAT'];
$ACTIVITES=$_POST['ACTIVITES'];
$SOUSACTIVITES=$_POST['SOUSACTIVITES'];
$req="INSERT INTO dfinances(RESULTAT,ACTIVITES,SOUSACTIVITES) VALUES ('$RESULTAT','$ACTIVITES','$SOUSACTIVITES)";
mysqli_query($conn,$req) or (die(mysqli_connect_error()));
?>
<html>
<head>
a2SAISI DES RESULTATSa2
<head>
<body>
<table border='1'>
<tr>
<td>RESULTAT:</td>
<td><?php echo($RESULTAT)?></td>
</tr>
<tr>
<td>ACTIVITES:</td>
<td><?php echo($ACTIVITES)?></td>
</tr>
<tr>
<td>SOUSACTIVITES:</td>
<td><?php echo($SOUSACTIVITES)?></td>
</tr>
</table>
</body>
</html> |
" Lorsque je saisie des données dans le formulaire, j'ai un écran blanc au lieu du formulaire. Ce dernier disparait.
MERCI D'AVANCE