Only certain rows on select list
<p>I have a dropdown select form which is based on a "brand" table that has more than 150 brand_name(s) with corresponding brandid(s).</p>

<p>As you can see in the code below, I all the brands/rows will appear in the dropdown form. I'd like to know if there is a way to exclude certain brands (without deleting them from the table; for example: they are temporarily out of stock). And not just LIMIT 1 to 7.</p>

<p>If for example, I want brand_names with brandids  9, 27, 50 etc. not to appear in the select option, how can it be done? Is there an EXCEPT() function of some sort?</p>

<pre><code>&lt;?php

echo "&lt;form action=\"chosen_brand.php\" method=\"get\"&gt;\n";

echo "&lt;select name=\"brand_name\"&gt;\n";

$stmt = mysqli_stmt_init($link);
if($stmt=mysqli_prepare($link,"SELECT `brandid`,`brand ` FROM `brand ` WHERE `brandid`"))
{
mysqli_stmt_bind_param($stmt,"i", $brandid);

mysqli_stmt_execute($stmt);

mysqli_stmt_bind_result($stmt,$brandid, $brand_name);

while(mysqli_stmt_fetch($stmt))   
      {
            echo "&lt;option value=\"$brandid\"&gt; $brand_name &lt;/option&gt;";     
      }     
      echo "&lt;/select&gt;\n";
      echo "&lt;input name=\"submit\" type=\"submit\" id=\"brandid\" value=\"submit\" /&gt;\n";
      echo "&lt;/form&gt; \n";

mysqli_stmt_close($stmt);

mysqli_free_result($result);
}

?&gt;
</code></pre>

<p>Thanks,
Jen</p>
