# Mysql help

**URL:** <https://www.ruby-forum.com/t/mysql-help/113024>\
**Category:** Rails\
**Created:** [August 26, 2007, 12:00pm UTC](https://www.ruby-forum.com/t/mysql-help/113024 "2007-08-26T12:00:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b5ac83/32.png) [@harper](https://www.ruby-forum.com/u/harper)\
**Post date:** [August 26, 2007, 12:00pm UTC](https://www.ruby-forum.com/t/mysql-help/113024/1 "2007-08-26T12:00:07Z")

</div>

does anyone know how to modify / change existing text in a db (replace  
func.) ?  
something like -

========DB========

table foods  
column fruit  
row 1  
“we really need to bring apples and fruit”  
row 2  
“we really need to bring oranges and mangos”  
row 2  
“we really need to bring apricots”

=======end result needed======

table foods  
column fruit  
row 1  
“we need to bring apples and fruit”  
row 2  
“we need to bring oranges and mangos”  
row 2  
“we need to bring apricots”

=========================

it would be something along the lines of the code below, but this only  
modifies the text shown at the end program; i need the text modified IN  
the db.

@foods = Food.find(:all)  
food\_rows = @foods.collect(&:fruit)  
food\_rows.each |r|  
r.gsub(“really”, “”)  
end

any help? many thanks for any tips.

shai

---

<div class="post-metadata">

**Author:** ![harper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b5ac83/32.png) [@harper](https://www.ruby-forum.com/u/harper)\
**Post date:** [August 26, 2007, 12:08pm UTC](https://www.ruby-forum.com/t/mysql-help/113024/2 "2007-08-26T12:08:39Z")

</div>

cancel this thread, i hope i’ve posted a clearer question (above this  
post) thx
