abisson Posted July 9, 2007 Share Posted July 9, 2007 Here you go! this is the code. I want to change the value of " aprouve ". In my sql data base it is either 1 or 0. What is wrong with this code?! Thanks a lot! -=PHP =- while($donnee = mysql_fetch_array($query)) $donnee['aprouve']=$_POST['aprouve']; if ($donnee['aprouve']=="1") echo "oui"; elseif ($donnee['aprouve']=="0") echo "non"; { echo "<tr>"; echo "<td>" . $donnee['id_nouvelle'] . "</td>"; echo "<td>" . $donnee['titre'] . "</td>"; echo "<td>" . $donnee['text'] . "</td>"; echo "<td>" . $donnee['description'] . "</td>"; echo "<td>" . $donnee['aprouve'] . "</td>"; echo "<td>" . $donnee['date_affichage'] . "</td>"; echo "<td>"; Quote Link to comment https://forums.phpfreaks.com/topic/59111-ifelse-question/ Share on other sites More sharing options...
trq Posted July 9, 2007 Share Posted July 9, 2007 What is wrong with this code?! Why don't you tell us what the problem is? Eg; What do you expect to happen and what is actually happening? Quote Link to comment https://forums.phpfreaks.com/topic/59111-ifelse-question/#findComment-293510 Share on other sites More sharing options...
aim25 Posted July 9, 2007 Share Posted July 9, 2007 First off you have a ton of syntax errors. Quote Link to comment https://forums.phpfreaks.com/topic/59111-ifelse-question/#findComment-293580 Share on other sites More sharing options...
LiamProductions Posted July 9, 2007 Share Posted July 9, 2007 Im new too PHP but under the first block of code it has { i thought it is suppose to be } Quote Link to comment https://forums.phpfreaks.com/topic/59111-ifelse-question/#findComment-293693 Share on other sites More sharing options...
per1os Posted July 9, 2007 Share Posted July 9, 2007 $donnee['aprouve']=$_POST['aprouve']; if ($donnee['aprouve']=="1") echo "oui"; elseif ($donnee['aprouve']=="0") echo "non"; while($donnee = mysql_fetch_array($query)) { echo "<tr>"; echo "<td>" . $donnee['id_nouvelle'] . "</td>"; echo "<td>" . $donnee['titre'] . "</td>"; echo "<td>" . $donnee['text'] . "</td>"; echo "<td>" . $donnee['description'] . "</td>"; echo "<td>" . $donnee['aprouve'] . "</td>"; echo "<td>" . $donnee['date_affichage'] . "</td>"; echo "<td>"; } I think thats what you were trying to get at. Quote Link to comment https://forums.phpfreaks.com/topic/59111-ifelse-question/#findComment-293699 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.