requête update ne fonctionne plus
Posté : 12 févr. 2010, 15:13
bonjour, je me casse la tête depuis bien 1 semaine sur un problème de requête UPDATE
j'ai une base avec une table stock
j'ai donc modifier mes fichiers php (liste, ajout et modif)
tout marche bien sauf pour mon fichier modif

merci d'avance pour votre aide.
j'ai une base avec une table stock
--
-- Structure de la table `stock`
--
CREATE TABLE IF NOT EXISTS `stock` (
`ID` int(8) NOT NULL auto_increment,
`page` varchar(8) NOT NULL default '',
`ref` varchar(20) NOT NULL default '',
`designation` varchar(50) NOT NULL default '',
`couleur` varchar(20) NOT NULL default '',
`taille` varchar(20) NOT NULL,
`position` varchar(20) NOT NULL default '',
`reel` int(6) NOT NULL default '0',
`mini` int(6) NOT NULL default '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3642 ;
--
-- Contenu de la table `stock`
--
INSERT INTO `stock` (`ID`, `page`, `ref`, `designation`, `couleur`, `taille`, `position`, `reel`, `mini`) VALUES
(1, '126', '101', 'Stylo Green Pen', 'BLEU ', 'S/T ', 'D25', 7, 4),
tout marchait parfaitement mais depuis peu j'ai rajouter un champ taille à ma tablej'ai donc modifier mes fichiers php (liste, ajout et modif)
tout marche bien sauf pour mon fichier modif
<?php
require_once("connexionMysql.inc.php");
if(isset($_POST['bouton']))
{
$requete="UPDATE stock SET
ref='".$_POST['ref']."' ,
page='".$_POST['page']."' ,
designation='".$_POST['designation']."' ,
couleur='".$_POST['couleur']."',
taille='".$_POST['taille']."',
position='".$_POST['position']."',
reel='".$_POST['reel']."' ,
mini='".$_POST['mini']."' WHERE ID='".$_POST['ID']."' " ;
mysql_query($requete);
//redirection vers liste du stock en fin de query
function redirection($url){
echo "<script type=\"text/javascript\">\n"
. "<!--\n"
. "\n"
. "function redirect() {\n"
. "window.location='" . html_entity_decode($url) . "'\n"
. "}\n"
. "setTimeout('redirect()','0');\n"
. "\n"
. "// -->\n"
. "</script>\n";
}
redirection('listestock.php');
}
//--------------requête de la fiche modif
$requete3="SELECT * FROM stock WHERE ID='".$_GET['ID']."' " ;
$resultat3=mysql_query($requete3);
$stock=mysql_fetch_array($resultat3);
?>
<!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" />
<link rel="icon" type="image/ico" href="../favicon.ico" />
<title>modif référence</title>
<link href="general.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="centrage">
<form id="monform" name="form1" method="post" enctype="multipart/form-data" action="stockModif.php">
<p>
<label>
<input type="submit" name="bouton" value="Sauver" />
</label>
<a href="../listestock.php" >retour stock</a>
</p>
<table width="950" border="0" cellspacing="2" cellpadding="0">
<tr bgcolor="#d3dce3">
<td><strong>Référence</strong></td>
<td align="center"><strong>Page</strong></td>
<td><strong>Désignation</strong></td>
<td><strong>Couleur</strong></td>
<td align="center"><strong>Taille</strong></td>
<td align="center"><strong>Position</strong></td>
<td align="center"><strong>Stock réel</strong></td>
<td align="center"><strong>Stock mini</strong></td>
</tr>
<tr >
<td ><input type="text" name="ref" value="<?php echo $stock['ref']; ?>" /></td>
<td align="center"><input type="text" name="page" value="<?php echo $stock['page']; ?>" /></td>
<td><input type="text" name="designation" value="<?php echo $stock['designation']; ?>" /></td>
<td><input type="text" name="couleur" value="<?php echo $stock['couleur']; ?>" /></td>
<td><input type="text" name="taille" value="<?php echo $stock['taille']; ?>" /></td>
<td align="center"><input type="text" name="position" value="<?php echo $stock['position']; ?>" /></td>
<td align="center"><input type="text" name="reel" value="<?php echo $stock['reel']; ?>" /></td>
<td align="center"><input type="text" name="mini" value="<?php echo $stock['mini']; ?>" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>
je ne vois pas d'où peut venir le problème? je suis même revenu en arrière en enlevant mon champ taille sur la base et de même sur mes fichiers php, mais sans succés merci d'avance pour votre aide.