Select from where

duke -  
 zip -
slt

$req = mysql_query("SELECT qtarticlestok, nomarticle from article where nomarticle = $listart");
$resultat = mysql_fetch_array($req);
echo"$resultat[qtarticlestok]";

donne Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\sitesweb\tp1\ajoutok.php on line 34

vous voyez pas pkoi ? SSVVPP

3 réponses

  1. XeL-mEvo Messages postés 3 Date d'inscription   Statut Membre 8
     
    $req = mysql_query("SELECT qtarticlestok, nomarticle from article where nomarticle='$listart' "); 
    $resultat = mysql_fetch_array($req); 
    echo $resultat["qtarticlestok"];
    7
  2. zip
     
    essaie while ($affiche =mysql_fetch_array($req){
    echo $afiche[0];
    echo $affiche[1];
    ------
    echo $affiche[2];
    }
    comentaire
    en effet mysql_fetch_array renvoi un tableau alors faut declarer une varable tableau pour recuperer les données !!!
    jespere ke ca taidera
    -2