mysql removing text from column entry and placing removed text in different column
Posted on 2010-09-03
Before I start I'm still learning mysql/php and EE is helping a lot! thanks to everyone for their past and indeed future assistance.
I have a database application written in php/mysql, I need to do some conversion on the customer name entry which has been used to hold the following information "loan - <customer name> - <ticket number>"
I need to remove "loan -" from `customer_name` and need to move <ticket number> to `contract`
Example data for customer_name is;
"loan - acme computers - 0029319382"
"loan - freds place - 0038227718"
"loan - big dave's hair salon - 093828232"
I need customer_name to be;
"big dave's hair salon"
and contract_number to be;
If this can be done in sql then thats great, if not then I'll need a way of doing it in php, I can list the entries from the DB ok, I'll just need the conversion code.