| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Eating Pie | MySql Update LIKE %...% Hello All, I am looking for a mysql statement that would allow me to update a particular section of a mysql field. For example "Hello, FGjgkg Gkfdgjhgkf Gjkfgjk <a href="gjgfkfg.com">GJHGDfg</a> Cheetoss " I would like to change <a href="blah.com">gfjdgk</a> to GFHGDfg Is this possible? Even if I have to run one sql statement 4 times for each part. (change <a href=" to [url=" for the first one, and so on) - Steve
__________________ I feel old. |
| |
| | #2 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | Possibly http://dev.mysql.com/doc/refman/4.1/...nction_replace Code: # REPLACE(str,from_str,to_str) UPDATE table SET field = REPLACE(field, '<a href="blah.com">gfjdgk</a>', 'GFHGDfg') WHERE id = 1;
__________________ |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |