无法将字符串插入数组

时间:2012-07-14 00:45:23

标签: php

this accepted answer运行良好,第1列和第2列设置为varchar。当我在表单中插入一个字符串但它不会将数据插入我的数据库。我知道这是因为我的字符串周围没有引号,例如“value”,但我不知道如何在php中处理这个问题?有没有人有任何想法?

1 个答案:

答案 0 :(得分:3)

呃......只需在值周围输入"吗?

 $sql2 .= '("' .$_POST['column1'][$i] . '", "' . $_POST['column2'][$i] . '")';