Afficher message paraport au donne de base donne

olmac - 17 avril 2019 à 21:39
SioGabx Messages postés 262 Date d'inscription mardi 21 août 2018 Statut Membre Dernière intervention 17 novembre 2022 - 22 avril 2019 à 04:47
Bonjour,
 mysql_connect("localhost","root","");
                                                mysql_select_db("gestion_stock");
                                                 $var=mysql_query("select *from produit");
                                           
                                                 
                                                  echo "<tr><th>NOM produit</th>
                                                            <th>Designation</th>
                                                            <th>Prix Unitaire</th>
                                                            <th>Quantité</th>
                                                            <th>Code Catégorie</th>
                                                            <th>Quantité Seuil</th>
                                               
                                                       </tr>";
                                                 
                                                   while($row = mysql_fetch_array($var)){
                                                  
                                                        if($row['NOM PRODUIT']= 'ANANAS ' ){
                                                                
                                                                   ECHO 'FRUIT';
                                                               
                                                                        }
                                                                    </style>
                                                                else{
                                                                   
                                                               ECHO 'LEGUME';
                                                        }
                                               
                                                      
                                       
                                            ?>




MAIS CE CODE CA NE DONNNE AUCUNE RESULTAT

1 réponse

SioGabx Messages postés 262 Date d'inscription mardi 21 août 2018 Statut Membre Dernière intervention 17 novembre 2022
Modifié le 22 avril 2019 à 04:49
Déjà mysql est obsolète -> https://www.php.net/manual/fr/function.mysql-connect.php
Il faut utiliser MySQLi ou PDO.
  ECHO 'FRUIT';
 }
</style>
else{
Mais que fait ce "</style>" au milieu de ton code ...?

PS : L'indentation de ton code est vraiment nul
0
Rejoignez-nous