Monday 15 March 2010

php - how to solve this Error from using in_array -



php - how to solve this Error from using in_array -

i have team page contains list of team members , select list contains list of friends. select list, can select friends added team (members). now, want ensure friends team members don't show in select list.

i tried below nil showing in select list, supposed show details of 1 friend not part of team members.

the code

<form action="tmembers.php" method="post"> <select multiple="true" name="members[]" val id="member" class=""> <?php while($record5 = $stmt5->fetch()){ //gets ids friend list $friends[] = $record5['id']; //array containing ids of friends } $membersarray[] = $members['id']; //array containing ids of team members foreach ($friends $t) { if (in_array($t, $membersarray)) { continue; } ?> <option value="<?php echo $record5['id'] ; ?>"> <?php echo $record5['surname'];?> <?php echo $record5['firstname'] ; ?> </option> <?php } ?> </select></br> <input type="submit" value="send invite" name="invite" class=""/> </form>

php html pdo

No comments:

Post a Comment