Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default Mysql help please (:

    Hey,

    I want to update all values in one column for all rows but not too sure how to do it.

    Basically. I have a column called game_swf the current value is 1.swf however i want to change it, so it's http://www.nexdana.com/nex_2010/content/games/1.swf

    Obviously it's not that simple as I have over 100 rows

    But, rather than do it all manually, is there a way to do it using a query?

    +rep to all replies and help

    Joe
    Joe


  2. #2
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Just do a normal update query without the where clause.

  3. #3
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Tomm View Post
    Just do a normal update query without the where clause.
    They've all got different values though, so 1.swf 2.swf etc (Which I didnt explain before though, sorry)

    PHP Code:
    UPDATE  `db`.`temp_games_table`  SET  `game_swf`  =  'http://www.nexdana.com/nex_2010/content/games/on-3.swf'
    would surely just change every value in the column to the above wouldn't it?
    Joe


  4. #4
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Ahh sorry, misunderstood what you were asking for.

    Try:

    Code:
    UPDATE `db`.`temp_games_table` SET `games_swf` = CONCAT('http://www.nexdana.com/nex_2010/content/games/', games_swf);

  5. #5
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Thanks Did me a massive favour +rep
    Joe


Posting Permissions

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