Display more than 2 columns for Autocomplete

(3 posts) (2 voices)

Tags:

  1. michelles, Member

    Is there a way to edit the autocomplete parameter so it displays 3 or more columns instead of only 2? I'm using autocomplete for cities and I'd like to be able to display "City, Region, Country" instead of only "City, Country" because there are multiple cities with the same name in some countries.

  2. myDBR Team, Key Master

    In MySQL you can use concat-function to combine multiple columns as one.

    select concat(city, ', ', region, ', ', Country), null, id
    from cities;

    Alternatively, the autocomplete can show region and country in separate line.

    select cirty, concat(region, ', ', Country), id
    from cities;

    --
    myDBR Team

  3. michelles, Member

    Thanks! Works perfectly.


Reply

You must log in to post.