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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.