标签:error nod 模块 error: erro mysq back bad callback
node中调用mysql模块读写时候,如果直接插入字符串:
connection.query(‘SELECT * from users WHERE name=‘ + data.name , callback);
或者:
connection.query(‘SELECT * from users WHERE name = alan‘ , callback);
会抛出这个错误。
正确写法应该是:
connection.query("SELECT * from users WHERE name= ‘alan‘ ", callback);
或者
connection.query("SELECT * from users WHERE name= ‘ "+ data.name+" ‘ ", callback);
Error: ER_BAD_FIELD_ERROR: Unknown column 'xxx' in 'where clause'
标签:error nod 模块 error: erro mysq back bad callback
原文地址:http://www.cnblogs.com/alan2kat/p/7773796.html