I am using the MySQL gem in order to write values to a MySQL table. The table has 2 fields: one is int
and the other is text
. However, when I开发者_如何学运维 write data (using Ruby MySQL gem) into the table, the text shows up as NULL. Any ideas?
My ruby code:
insert_new = db.prepare "INSERT INTO keywords (id, name) VALUES (?,?)"
insert_new.execute i, element.text.to_s
精彩评论