Maria db值未插入?

时间:2016-06-17 07:49:39

标签: mysql node.js express mariadb mariasql

我正在使用Maria db。这些值未插入数据库。我从我的路线传递了Json数组的值。

var insertValues = {'username': username, 'firstname': firstname, 'lastname': lastname, 'email': email,
                        'password':password, 'profileType': profileType,'userType': userType, 'gcmId': gcmId,
                        'deviceName': deviceName, 'osType': osType, 'osVersion': osVersion,'isBlocked':isBlocked,
                        'isActive':isActive, 'ofActive':ofActive};

获取此值的函数是:

function registerUser(insertValues,callback)
{
    model.client.query('insert into users set ?',insertValues,function(err) {
      if(!err)
            callback({"success":'1'});
        else
            console.log(err);
            callback({"success":'0'});
    });
}
module.exports.registerUser=registerUser;

它返回如下错误:

Maria Db Connected at : 128.199.242.240
{ [Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NULL' at line 1] code: 1064 }

0 个答案:

没有答案