Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- php, how to search and replace in mysql database?
- foreach($rowset as $row) {
- $replacement=preg_replace('/<strong>(.)/','1<strong>',$row->fieldname,1);
- myDBCall('update mytable set myfield="'.$replacement.'" where someid='.$row->someid);
- }
- update `table` set `fieldname` = replace(`fieldname`,'string_to_find','string_to_replace_with')
Advertisement
Add Comment
Please, Sign In to add comment