slt, tout le monde ,j'as un problem sur mon code mysql ,ca marche pas j'essayer plusieur fois, aider moi svp!
voila mon script :
<!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>commentaire</title>
<style>
.bouton{
background-image:url(image/envoyer.jpg);
width:127px;
height:32px;
border:0px;
}
</style>
<?php
$nom=$_POST['nom'];
$email=$_POST['email'];
$message=$_POST['message'];
$dat="sds";
$validation="oui";
if($nom!="" & $email!="" & $message!="" )
{
$db=mysql_connect('localhost','root','');
if(!mysql_select_db('commentaire'))
{
echo"pas de base de donnes trouvee";
die;
}
$m = "insert into table (nom,email,message,date,validation)
VALUES ('nom','email','message','dat','validation')";
mysql_query($m);
$num=mysql_affected_rows();
if($num>0)
{
echo"une donnee est ajouter a votre base de donnee commentaire ";
}
elseif($num<0)
{
echo"pas de donnees ajouter";
}
mysql_close($db);
}
else
{
$r="tout les champs sont obligatoire???";
}
?>
</head>
<body>
<form action="commentaire.php" method="post">
<table width="442" border="0">
<tr>
<td width="92">Nom</td>
<td width="334"><input type="text" name="nom" id="textfield" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" id="textfield" /></td>
</tr>
<tr>
<td>message</td>
<td><label>
<textarea name="message" id="textarea" cols="45" rows="5"></textarea>
</label></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="" class="bouton" />
<label></label></td>
</tr>
</table>
</form>
</body>
</html>