1 Reply Latest reply on Jul 17, 2008 6:15 PM by mohnkhan

    drop down menu poulated by 2 db columns

      I have a form where I enter information into a table. There is a drop down menu in the form where the id is connected to another table. Basically I'm pulling names from another table. I've got an id that connects fine.

      However, I'd like to pull 2 columns into the one drop down menu selections. I n my other table I have a firstname and lastname column. I'd like to pull both those columns into the one drop down menu.

      Ideally each line in the drop down menu would read "lastname, firstname"

      Thanks in advance!

      Peter T
        • 1. Re: drop down menu poulated by 2 db columns
          mohnkhan Level 1
          what database are you using ?

          u can simply do like this..
          for example..

          SELECT concat(convert(FirstName using UTF8)," - ",convert(Lastname using UTF8)) as FullName, userid
          FROM employees

          here i concat two fields Lastname and firstname
          this is mysql specific.
          if u still cannot do it
          post ur table schema here i will write it for u

          hope this helps.

          Regards.
          mohnkhan
          http://www.mohitech.com