我想将如下所示的哈希插入到 mysql 列中,
{:sub => ["at","div.product-info"],
1 => [["at","span#hs18Price"]],
:avail => ["at","strong.out_stock"],
:soffer => ["at","div.freebie"],
:stime =>["search","div[@class='costs']//span[@class='days']"],
:scost => [300,30] }
我试过了,它抛出以下错误,
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'costs...
有什么帮助吗?
编辑:
忘记事件记录和序列化吧。我想在原始 sql 中执行此操作。
最佳答案
您需要转义散列中的单引号
关于mysql - 我可以将 ruby 哈希存储在 mysql 数据库列中吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15567569/