je n'arrive pas à faire marcher un Formulaire de modification
<?php
include('config.php');
//récupération des valeurs des champs:
$id = $_POST["id"] ;
$annonce = $_POST["annonce"] ;
//récupération de l'identifiant de la personne:
$id = $_POST["id"] ;
//création de la requête SQL:
$sql = "UPDATE admin
SET id = '$id',
annonce = '$annonce' WHERE id_annonce='1'";
//exécution de la requête SQL:
$requete = mysql_query($sql, $cnx) or die( mysql_error() ) ;
//affichage des résultats, pour savoir si la modification a marchée:
if($requete)
{
echo("Modifications have been taken into account") ;
}
else
{
echo("La modification à échouée") ;
}
?>
Index<form name="modifier" action="modification.php" method="POST">
ID (1=mise 0=pas mise) :<br/><input type="text" name="id" style="padding: 5px 10px; border: #CCC solid 2px; border-radius: 5px; width:998px; height:26px; font-size:18px" value=""><br/>
Text de l annonce : <br/><input type="text" name="annonce" style=" padding: 5px 10px; border: #CCC solid 2px; border-radius: 5px; width:998px; height:26px; font-size:18px"><br/><br/>
<input type="submit" name="button" id="button" value="Modifier" style="width:998px; height:40px; border: none; border-radius: 5px; background: #CCCCCC; color:#FFF; font-family: Open Sans', sans-serif; font-size:18px; font-weight:bold;">
</form>
Sa me mets :Merci beaucoupWarning: mysql_query() expects parameter 2 to be resource, null given in /modification.php on line 18