Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
array
Vetrivel Vetrivel
2/20/2009 4:34:00 PM
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,.
--
Posted via
http://www.ruby-...
.
1 Answer
lasitha
2/20/2009 6:19:00 PM
0
On Fri, Feb 20, 2009 at 10:03 PM, Vetrivel Vetrivel
<vetrivel.bksys@gmail.com> wrote:
> 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...
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
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
array
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password