What is the best way to update a field for each row in a table?

Posted by pixel on Stack Overflow See other posts from Stack Overflow or by pixel
Published on 2010-05-11T18:55:46Z Indexed on 2010/05/11 19:04 UTC
Read the original article Hit count: 183

Filed under:
|
|

I have a table called artists. Within it, there is a field for the artist name (artist_name). Then there is a field for SEO friendly artist name, we'll call it search_name.

I have over 40,000 artists in this table. So, I'd like to convert all artists names to search friendly. What is the best way to accomplish this? Not looking for code here, just ideas.

This is what I have thus far. I'm just not sure if I should call all 40,000 artists, loop through them and update?

// Does this artist name have any symbols, apostrophes, etc. If so, strip them out

// Does this artist have a space (the beatles)? If so, replace with + (the+beatles).

// insert into search field

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql