lundi 17 décembre 2018

I have a php code with an sql query for a drop down menu for categories search and a few days ago it appears some NULL fields

PHOTO_SEARCHBOX1Here is the coding and i will attach a photo of the result: (word kathgoria refers to category of a product and it is a string)enter image description here

$strQuery5 = "SELECT DISTINCT kathgoria FROM products WHERE timh1 != 0 AND Transitional = 0 AND hidden = 0 ORDER BY kathgoria ";

          $rsrcResult5 = mysql_query($strQuery5);

          while($arrayRow5 = mysql_fetch_assoc($rsrcResult5)) {
              $strB5 = array_merge((array)$strB5,(array)explode(",", $arrayRow5["kathgoria"])); 
          }

          $cnt5 = count($strB5); 
          $strB5 = array_unique($strB5);

          for($j = 0; $j <= $cnt5; $j++){
              //////////////
              if($strB5[$j] != "" && $strB5[$j] != "Offers" /*&& $strB5[$j] != "DealsOfTheMonth"*/ && $strB5[$j] != "Stock" /*&& $strB5[$j] != "Persian"*/){ //kurdi change $strB5[$j] != "Persian"
                      //$tempVar = "~".$strB5[$j]; 
                      $tempVar = $strB5[$j]; 
                      $tempVar2 = "+".$strB5[$j];
                      echo "<option value=\"".$tempVar."\" ";
                      if ($strB5[$j] == $_SESSION['kathgoria']){echo " selected ";}
                      echo ">".$lang[$tempVar2]."</option>\n";
              }
          } //for

      echo "</select>";

Here is a screenshot from what i can see in the searchbox:




Aucun commentaire:

Enregistrer un commentaire