我正在使用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 }