数据库语句:
"select * from user where binary "+" username="+username+"
and password="+password+"
and type="+type;
目的:查询用户名,密码,type来判断用户是否存在and正确
报错:Error: ER_BAD_FIELD_ERROR: Unknown column 'undefined' in 'where clause'
code: 'ER_BAD_FIELD_ERROR',
errno: 1054,
sqlMessage: "Unknown column 'undefined' in 'where clause'",
sqlState: '42S22',
index: 0,
sql: 'select * from user where binary username=undefined
and password=undefined
and type=NaN'
}
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "登录失败".] {
code: 'ERR_UNHANDLED_REJECTION'
数据库检查了列名对而且没有空格