PDA

View Full Version : Mysql help please (:



iJoe
12-01-2010, 08:05 PM
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 :P

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

+rep to all replies and help

Joe (:

Tomm
12-01-2010, 08:10 PM
Just do a normal update query without the where clause.

iJoe
12-01-2010, 08:12 PM
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)


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?

Tomm
12-01-2010, 08:35 PM
Ahh sorry, misunderstood what you were asking for.

Try:



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

iJoe
12-01-2010, 08:43 PM
Thanks (: Did me a massive favour +rep

Want to hide these adverts? Register an account for free!