#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0

    Smile How to add an extension to a field


    Hallo, I'm new in this forum and I'm sorry to start using it taking info and not giving it !

    I have a table with a numeric value column and I need to add an extension

    column_name
    -------------------
    300
    -------------------
    250
    -------------------
    750

    I need it to become

    column_name
    -------------------
    300.gpx
    -------------------
    250.gpx
    -------------------
    750.gpx

    I think I need to use CONCAT but I didn't understand how
    Could someone help me?
    Thanks in advance
    Graziano
  2. #2
  3. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    Yes you would use CONCAT, what about it do you not understand?
    Show us what you have tried.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0
    Originally Posted by Guelphdad
    Yes you would use CONCAT, what about it do you not understand?
    Show us what you have tried.
    thanks to interesting in my issue Guelphdad, considered I'm not skilled on mysql, when I need a query I look around and I search the query I need, in this case after hours of Google search I found only this, but is not completely my case

    UPDATE `tabel` SET column = CONCAT(%, '.png')
    where field_name='the field value here'; #optional condition

    could you help me?
    Thanks
    Graziano
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2008
    Posts
    1,927
    Rep Power
    378
    UPDATE `tabel` SET column = CONCAT(column, '.png');

    ?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0
    Originally Posted by cafelatte
    UPDATE `tabel` SET column = CONCAT(column, '.png');

    ?
    It works !
    Thanks!
  10. #6
  11. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    Even before you waste time with a search of the whole web which is likely to turn up syntax that isn't compatible with the database you are working on, it is best to consult the manual.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0
    Originally Posted by Guelphdad
    Even before you waste time with a search of the whole web which is likely to turn up syntax that isn't compatible with the database you are working on, it is best to consult the manual.
    Yes, this is a good example of how important is to now, if you have a paypal account I would be happy to offer you a beer.
  14. #8
  15. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    Originally Posted by grazianodemaio
    Yes, this is a good example of how important is to now, if you have a paypal account I would be happy to offer you a beer.
    Thanks for the offer I don't have one though.

    But study up and as you get better you can help others with their problems.

    pay it forward!
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2008
    Posts
    1,927
    Rep Power
    378
    Hang on; ~I~ have one!

    Has the moment passed? :-(

    ;-)

IMN logo majestic logo threadwatch logo seochat tools logo