Remove Duplicate Fields in Auto Populate Drop Down

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 19, 2015   (RSS)

By nmsinc - June 18, 2015

I have auto populate script below that I need modified to remove duplicate last names. For instance, if I have more than one last name of "White" all of them appear in the drop down as I'm typing. Is there a way to remove these duplicates when they are present?

Thanks - nmsinc

 Locate Last Name:   
                <label for="last_name"></label>
                <input name="last_name" size="10%" style="width: 10%" id="last_name" />
                <script>
                $( "#last_name" ).autocomplete({  source: [
                <?php foreach (mysql_select("daily_log", "assigned_to ORDER BY last_name") as $Groups): ?>
                "<?php echo $Groups['last_name'];?>",
                <?php endforeach ?>
                ]});
                </script>

nmsinc

By ht1080z - June 19, 2015

Hi nmsinc

Why don't you try adding GROUP BY last_name?

Karls