Hi, I have a database with 9000+ entries (recipes) Basically for the title they are for example: Cheese on Toast recipe Bacon Sandwich recipe Now, 9000 of those will take a very long time to edit so I just wondered if there was a command that would allow me to remove the " recipe" from the title on every post? Thanks
here you go very fast solution http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
EDIT: Beat me to it^^ mysql_query(" UPDATE table_name SET recipe_name = REPLACE(recipe_name, ' recipe', '') ") OR die(mysql_error()); PHP: I could imagine this being good for search engines, but if you want to remove it, the above code should do what you want. You still should make a backup of the database though, before running queries that affect a high amount of rows.