Modifier un enregistrement
Bonjour,
je creé un code de modification dans la table module sur les champs
lib_module et coef_mod mais cette ne afficher aucun résultat s'il vous plait s'il vous plait aider moi
le code
listModule.php
<?php
$host="localhost";
$user="root";
$pass="";
$db="universite";
mysql_connect($host,$user,$pass) or die("Impossible de se connecter : " . mysql_error());
mysql_select_db($db) or die("Erreur: " . mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$resultat=mysql_query("select * from module where lib_module='".isset($_GET["lib_module"])."'");
if($resultat){
echo"<h1> module</h1>\n";
$mod=mysql_fetch_array($resultat);
echo"<form action='listeModule.php' methode='POST'>";
echo"<table border='1'>\n";
echo"<tr>\n";
echo"<td>libelle module</td>\n";
echo"<input type='text' name='lib_module' value='".$mod["lib_module"] ."'/></td>\n";
echo"<td>coefision</td>\n";
echo"<input type='text' name='coef_mod' value='".$mod["lcoef_mod"] ."'/></td>\n";
echo"</tr>";
echo"</table>\n";
echo"</br>";
echo"<input type='hidden' name='lib_module' value='".$_GET["lib_module"]."'/>\n";
echo"<input type='submit' name='modifier' value='modifier '/>";
echo"</form>";
}?>
</body>
</html>
affichemodule.php
<?php
$host="localhost";
$user="root";
$pass="";
$db="universite";
mysql_connect($host,$user,$pass) or die("Impossible de se connecter : " . mysql_error());
mysql_select_db($db) or die("Erreur: " . mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$resultat=mysql_query("select * from module where lib_module='".isset($_GET["lib_module"])."'");
if($resultat){
echo"<h1> module</h1>\n";
$mod=mysql_fetch_array($resultat);
echo"<form action='listeModule.php' methode='POST'>";
echo"<table border='1'>\n";
echo"<tr>\n";
echo"<td>libelle module</td>\n";
echo"<input type='text' name='lib_module' value='".$mod["lib_module"] ."'/></td>\n";
echo"<td>coefision</td>\n";
echo"<input type='text' name='coef_mod' value='".$mod["lcoef_mod"] ."'/></td>\n";
echo"</tr>";
echo"</table>\n";
echo"</br>";
echo"<input type='hidden' name='lib_module' value='".$_GET["lib_module"]."'/>\n";
echo"<input type='submit' name='modifier' value='modifier '/>";
echo"</form>";
}?>
</body>
</html>
merci
je creé un code de modification dans la table module sur les champs
lib_module et coef_mod mais cette ne afficher aucun résultat s'il vous plait s'il vous plait aider moi
le code
listModule.php
<?php
$host="localhost";
$user="root";
$pass="";
$db="universite";
mysql_connect($host,$user,$pass) or die("Impossible de se connecter : " . mysql_error());
mysql_select_db($db) or die("Erreur: " . mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$resultat=mysql_query("select * from module where lib_module='".isset($_GET["lib_module"])."'");
if($resultat){
echo"<h1> module</h1>\n";
$mod=mysql_fetch_array($resultat);
echo"<form action='listeModule.php' methode='POST'>";
echo"<table border='1'>\n";
echo"<tr>\n";
echo"<td>libelle module</td>\n";
echo"<input type='text' name='lib_module' value='".$mod["lib_module"] ."'/></td>\n";
echo"<td>coefision</td>\n";
echo"<input type='text' name='coef_mod' value='".$mod["lcoef_mod"] ."'/></td>\n";
echo"</tr>";
echo"</table>\n";
echo"</br>";
echo"<input type='hidden' name='lib_module' value='".$_GET["lib_module"]."'/>\n";
echo"<input type='submit' name='modifier' value='modifier '/>";
echo"</form>";
}?>
</body>
</html>
affichemodule.php
<?php
$host="localhost";
$user="root";
$pass="";
$db="universite";
mysql_connect($host,$user,$pass) or die("Impossible de se connecter : " . mysql_error());
mysql_select_db($db) or die("Erreur: " . mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$resultat=mysql_query("select * from module where lib_module='".isset($_GET["lib_module"])."'");
if($resultat){
echo"<h1> module</h1>\n";
$mod=mysql_fetch_array($resultat);
echo"<form action='listeModule.php' methode='POST'>";
echo"<table border='1'>\n";
echo"<tr>\n";
echo"<td>libelle module</td>\n";
echo"<input type='text' name='lib_module' value='".$mod["lib_module"] ."'/></td>\n";
echo"<td>coefision</td>\n";
echo"<input type='text' name='coef_mod' value='".$mod["lcoef_mod"] ."'/></td>\n";
echo"</tr>";
echo"</table>\n";
echo"</br>";
echo"<input type='hidden' name='lib_module' value='".$_GET["lib_module"]."'/>\n";
echo"<input type='submit' name='modifier' value='modifier '/>";
echo"</form>";
}?>
</body>
</html>
merci
1 réponse
-
Je comprends pas ce que tu as écrit....
Tu souhaites faire une modification dans ta BDD en fonction de ce que la personne entre dans ses inputs et le mettre à la place des anciennes données ?-
-
-
@DesTunKmonsieur
consulter cette vidéo pour comprendre ma question
https://www.youtube.com/watch?v=uvm4TYNXFrg
je realise le meme code qui contient dans cette video mais les donneés est different
désolé pour le dérangement et Je ne sais pas le français
merci monsieur -
-