0
我使用socket.io和node-mysql module.kindly幫助編輯代碼。我如何做這項工作?socket.io mysql two和clauses
socket.on('join',function(data){
var srecord = {m_from: data.usid, m_to:data.tid};
dbconn.query('SELECT m_from,m_text FROM messages WHERE (m_from = ? AND m_to = ?) OR (m_to = ? AND m_from = ?)',[data.usid,data.tid],function(err, records){
if(err) throw err;
socket.emit('output',records);});
});
如果執行,它顯示錯誤:檢查手冊,對應於你的DB服務器正確的語法使用附近? AND m_from =?)'