PHP Code Igniter数据库错误

问题描述

| 无法在这里找出问题所在:
class Model_form extends CI_Model
{
  function __construct()
  {
        // Call the Model constructor
        parent::__construct();
  }

  function add_tree()
  {
    $v_treename = $this->input->post(\'f_treename\');
    $v_treedesc = $this->input->post(\'f_treedesc\');
    $v_treeid = $v_treename;
    $this->db->query(\"INSERT INTO trees (index,tree_name,tree_desc,tree_id) VALUES (NULL,\'$v_treename\',\'$v_treedesc\',\'$v_treeid\') \"); //PROBLEM OCCURS HERE
} 
得到这个错误: 发生数据库错误 错误号:1064 您的SQL语法有误;检查与您的MySQL服务器版本相对应的手册,以在\'index,tree_name,tree_desc,tree_id附近使用正确的语法)VALUES(NULL,\'TEST \',\'TEST \',\'TEST \')\ '在第1行 我在另一个项目上使用过类似的代码,但效果很好。使用MAMP在本地服务器上运行。感谢您的任何帮助,您可以提供。     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)