Hey,
Just in case you're wondering I need some help with the marvellous thing called Arrays. No, there's no sarcasm anywhere here.
Alright.. here's the problem.
I have an array which is pulled from 2 tables, this is then put into a select box. The problem is there are some duplicates because there can be names in both tables.
Here's the code I have so far:
<?
$cursor = mysql_query("select * from clientlogic.authlist");
while ( $row = @mysql_fetch_array($cursor) ){
$name = $row["name"];
$arraybuild[] = $name;
}
$cursor = mysql_query("select * from clientlogic.team_members where `ps` = '1' and `team` != 'trash' and `team` != '?'");
while ( $row = @mysql_fetch_array($cursor) ){
$name = $row["member"];
$arraybuild[] = $name;
}
sort($arraybuild);
?>
<select name="c_authorised" class="form" TABINDEX="12" STYLE="width:200px;">
<option><?php print"$agentsname"; ?></option>
<? for ($i=0; $i<count($arraybuild);$i++) {?>
<option<?php if($display_c_authorised=="$arraybuild[$i]") {echo" SELECTED";} ?>><?php print"$arraybuild[$i]"; ?></option>
<? } ?>
</select>
The select box works great - it includes names from both tables but how (easily) would I get rid of the duplicate names.
Cheers
Mark