catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

When inserting data, it is sometimes necessary to add the quotation marks to the array to perform the success #555

Closed just-wkj closed 7 years ago

just-wkj commented 7 years ago

When inserting data, it is sometimes necessary to add the quotation marks to the array to perform the success eg: $openid ,"$openid" $openid = 'myopenid'; $db->insert("mytable", array("openid" => "$openid")); $db->last_query(): INSERT INTO "mytable" ("openid") VALUES ("myopenid") $db->insert("mytable", array("openid" => $openid)); $db->last_query(): INSERT INTO "mytable" ("openid") VALUES () !!!! empty!!! // 使用insert方法的插入数据的时候,有时会存在 拼接好的sql语句缺少value,必须加上引号才能执行成功,

catfan commented 7 years ago

There is no problem for the code you shown. Perhaps you have to tell more detail about what kind of sometimes is. It should not be the problem.

Secondly, what's the version of Medoo? The latest version had changed last_query() to last().