# Insert record in mysql

**URL:** <https://www.ruby-forum.com/t/insert-record-in-mysql/173915>\
**Category:** Rails\
**Created:** [August 18, 2009, 8:46am UTC](https://www.ruby-forum.com/t/insert-record-in-mysql/173915 "2009-08-18T08:46:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 18, 2009, 8:46am UTC](https://www.ruby-forum.com/t/insert-record-in-mysql/173915/1 "2009-08-18T08:46:18Z")

</div>

Hello All

i want to insert multiple record in 1 column.

i upload multiple image it’s name i want to store for ex.  
a.jpg,b.gif,c.png like this

my html code is like this

Image : \<%= f.file\_field :image,:name =\> "service[image0]" %\>\<% f.file\_field :image, :type =\> 'hidden', :id =\> 'image1'%\> 

and only controller change require but i have no idea

my controller

def create  
for i in count(params[:image])  
puts i  
end  
exit  
@path =  
File.join("#{RAILS\_ROOT}/public/images/",params[:service][:image].original\_filename)  
File.open(@path, “wb”){|f| f.write(params[:service][:image].read)}  
params[:service][“user\_id”] = session[:user\_id]  
@service = Service.new(params[:service])  
@service.image=params[:service][:image].original\_filename

```
  respond_to do |format|
      if @service.save
         flash[:notice] = 'Service was successfully created.'
         format.html { redirect_to(users_url) }
         format.xml { render :xml => @service, :status => :created,

```

:location =\> @service }  
else  
format.html { render :action =\> “new” }  
format.xml { render :xml =\> @service.errors, :status =\>  
:unprocessable\_entity }  
end  
end  
end

i got array like this

image0 =\> file1 with path  
image1 =\> file1 with path  
image2 =\> file2 with path  
but i want store whole in image field separating comma
