I have a column in MySQL table. I want to delete a phrase that is repeated in all records of the column example of the column: 267000 <a href="http 34600 <a href="http 54890 <a href="http 211100 <a href="http this expression I want delete '<a href="http' I tried this update col set price= replace (price, '<a href="http', '') ; PHP: my be REGEX?? but all records are replaced by price I want to remain only number Thanx!
Well just change price column to integer? ALTER TABLE `col` CHANGE `price` `price` INT( 10 ) NOT NULL Only numbers will remain.
You can use also something like this: update col set price=substr(price, 1, locate(price, '<a href="http')); Code (markup): Ðренда квартир Киеве Сдать квартиру в Киеве Купить дом под Киевом Купить коттедж под Киевом
i think the idea given by ven is good. but it will not allow u to add any characters later on if u do want to. its better to use the way suggested by livedatesearch as it will crop the entry and let only the numbers remain as well as retain the property of the column.