array

V

Vetrivel Vetrivel

In array I have content like this

a = ["c" , "d", "e" , "f" ]
But I need like this

'c','d','e','f'

I want this for my following purpose
insert into tablename values a .

a has to subtitude in below statement,.
 
L

lasitha

In array I have content like this

a = ["c" , "d", "e" , "f" ]
But I need like this

'c','d','e','f'

I want this for my following purpose
insert into tablename values a .

While the ruby to do that is trivial, i feel its more important that i
point out you should _never_ construct a SQL statement like this -
it's a classic security hole.

http://en.wikipedia.org/wiki/SQL_injection or just google sql injection.

Whatever tool you're using to interface with your database, it will
certainly have a safe way to pass parameters into a sql statement.
Please look that up - it will make the world safer and bypass your
original problem to boot :)

Cheers,
lasitha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,179
Messages
2,570,956
Members
47,509
Latest member
Jack116

Latest Threads

Top