like this…
res = dbh.query(“INSERT INTO word (u, up, temp) VALUES(‘check’,
‘check’,
#{@mytext})”)
although I’d wager that since you aren’t using ActiveRecord that there
is probably a much easier way to accomplish your goal
_Kevin
My transations should be very simple. reading, copying to variables and
writing. But do i need to add a gem for activerecord? I might take a
look at it in case i need to implement it.
like this…
res = dbh.query(“INSERT INTO word (u, up, temp) VALUES(‘check’,
‘check’,
#{@mytext})”)
Not seeing the data in the table after applying this. Something is
wrong.
You would need
“INSERT INTO word (u, up, temp) VALUES(‘check’, ‘check’, ‘#{@mytext}’)”
This does however leave you open to all sorts of sql injection nasties
Fred
I was thinking of just being strict with what i allow in. Testing it
when it comes in and removing brackets and things. maybe some banded
words like the sql main words. Is there another recommended way though.
This shouldnt end up being online but it will be public.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.