Jump to content

searching arrays


witham

Recommended Posts

I am a little confused as to where to put the array_unique, could you help please:


[code]<tr><td><b>Product Name:</b></td>

<!--put the query $sqlPRODNAME into the $result variable or display error if query fails-->

<?


$result  = mysql_query($sqlPRODNAME, $dblink)
or die("<p>Error Processing Query</p><hr /><p>".mysql_error()."</p>\n");


// mysql_fetch_array fetches the results from the query a row at a time and populates the drop down box each time it's called
// the result is returned as an array that can be referenced either by field name or by it's index, "ALL" is hardcoded because
//it is always constant and allows the % query to be executed


echo '<td><select name="Equivalent">';
echo '<option value = "%"><b>ALL';

while ($row = mysql_fetch_array ($result))



// loop through the rows outputing them as select options
  {
echo '<option value="' . $row["PRODEQUIV"] . '">' . $row["PRODEQUIV"] . "</option>";
  }
?>
</select></td></tr>[/code]
Link to comment
https://forums.phpfreaks.com/topic/17551-searching-arrays/#findComment-74766
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.