Results 1 to 5 of 5

Thread: explode a cell

  1. #1
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132

    Unanswered: explode a cell

    hi,
    how to explode a field content?

    thanks
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    INSERT INTO table (tablecell) VALUES ('dynamite');

    UPDATE table SET tablecell.fuse = 'on fire'

    stand well back
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132
    Quote Originally Posted by r937
    INSERT INTO table (tablecell) VALUES ('dynamite');

    UPDATE table SET tablecell.fuse = 'on fire'

    stand well back
    how to split a field

    field
    1-2
    3-5
    6-7
    7-10

    in php its explode
    explode('-', $field)

    but i dont know in mysql
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    use SUBSTRING_INDEX function
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132
    thanks! good tutor....

    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

Posting Permissions

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