SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    create list box from text field contents

    Hi All,

    I have a MYSQL table that has a longtext field with items separated by semicolons. I'd like to figure out a query and/or php code that when the user selects a record from a list, the longtext field will display as a scrolling item list adjacent to the main list. So the query/code will have to break out the items in the longtext field using the semicolon as a separator and then display those items in a list box adjacent to the highlighted record in the main list box.

    Thanks in advance for any suggestions.

    Lyle

  2. #2
    SitePoint Mentor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,267
    Mentioned
    33 Post(s)
    Tagged
    5 Thread(s)
    Hi Lyle,

    You can use the explode function to split the longtext field into an array, which you can then loop over to build your list box from.

  3. #3
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much!!!

    Best,

    Lyle


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •