1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help trying to move data around

Discussion in 'Databases' started by schlogo, Jul 17, 2013.

  1. #1
    Hello
    I am trying to do the following . I have 200 users in a table.For each user, in the plugin column are stored additionnal informations, in the format described below

    {
    "userExtendedFieldscontact":"contact"
    "userExtendedFieldsaddress":"address",
    "userExtendedFieldsaddress2":"",
    "userExtendedFieldszipCode":"zipcode",
    "userExtendedFieldscity":"city",
    }

    What i need to do is to split those in different columns, keeping only the values (data1, data2 etc ...)

    So basically, what i'm trying to do is :
    for each user extract contact and put it in userExtendedFieldscontact column
    extract address and put it in userExtendedFieldsaddress column
    extract address2 and put it in userExtendedFieldsaddress2 column
    extract zipcode and put it in userExtendedFieldszipcode column
    extract city and put it in userExtendedFieldcity column
    columns already exist
    I am trying to do it using the set instruction but i'am struggling to build the right mysql query to get the values. Help would be very much appreciated on this

    tks !
     
    schlogo, Jul 17, 2013 IP
  2. vwtom

    vwtom Greenhorn

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #2
    Just curious...that looks like JSON data. Why not just use it from that table?
     
    vwtom, Jul 31, 2013 IP
  3. schlogo

    schlogo Well-Known Member

    Messages:
    1,615
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Hello
    Sorry for the late answer, data is from a Joomla k2 plugin, it stores values in one field. I ve decided to create separate field for each value. I just need to move them to the right place now.

    I want to give users the ability to mofidy the values and myself a way to export to excel

    tks
     
    schlogo, Aug 9, 2013 IP