I'm make an object or an array from the results of a query to my MySQL
database. The value returned is entered in <option>s and any repeated
values are unwanted. Is there a way to remove them easily?
eg.
<select>
<? $qid = mysql_query("SELECT this FROM that WHERE here");
while ($r = mysql_fetch_object($qid)) { ?>
<option><?=$r->this?></option>
<? } ?>
</select>
I was thinking of creating an array before the while, then in the while add
each "$r->this" if "(! in_array($arr))". Then I would have to do another
while with the <option> included. But I'm not really sure how to add
elements to existing arrays. And that might not even be the best way. Any
iteas?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]