Jump to content

If...else question


abisson

Recommended Posts

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>";   

   

 

Link to comment
https://forums.phpfreaks.com/topic/59111-ifelse-question/
Share on other sites

$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.

Link to comment
https://forums.phpfreaks.com/topic/59111-ifelse-question/#findComment-293699
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.