0

Hello,

I am trying to populate a listbox.here are my codes which works fine.

 <?php
                            echo "<select name=name value=''>Exten Name</option>";
                            while($nt1=mysql_fetch_array($result_users)){//Array or records stored in $nt
                                echo "<option value=$nt1[name]>$nt1[name]</option>";
                                /* Option values are added by looping through the array */
                            }
                            echo "</select>";// Closing of list box
                            ?>

These data are taken from table Users and save to table queue.

i want to add a validation where it check if a user already exists in table queues, if it does exist, it should not available in the listbox.

Can you advise how to start and where to put the arguments.

Edited by shaqib: edit title

4
Contributors
4
Replies
13
Views
4 Years
Discussion Span
Last Post by phoenix_2000
0

Just use distinct names, just like in the code below;

SELECT DISTINCT name FROM ...

This will return only one instance of the records from the database.

Edited by Webville312: Made some ajustments

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.