I can't seem to figure this one and would appreciate some pointers as Im not convinced Im even using the correct command  Assume the following basic setup:
------------------------------
| Product_inventory
------------------------------
| Name | Description |
------------------------------
| Item 1 | <p>Blah blah
| Item 2 | <p>Filler content
| Item 3 | <p>Text text
| Item 4 | <p>More random
What I would like to do is automatically copy each rows 'Name' into the 'Description' column to preceed the already existing text. So the Description for Item 1 would read as "Item 1 <p>Blah blah"
I've been playing with the replace command and whilst it allows me to insert text at the beginning of each description I haven't figured out the correct SQL to copy the 'Name' fields (its just printing "Name" instead of the actual product title). This method also doesn't account for a description containing multiple <p>
Code:
UPDATE Product_inventory SET `Description` = replace(`Description`, "`Name` <p>", "<p>")
Am I on the right path? Cheers 
|