urllib下载图片存保到mysql库出错。查找资源都找不到解决方法。
发布于 12天前 作者 mrlong 125 次浏览 来自 问答

提示: { [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘0,0,X’ffd8ffe000104a46494600010100000100010000ffdb0043000d090a0b0a080d0b0a0b0e0e’ at line 1] code: 'ER_PARSE_ERROR’, errno: 1064, sqlState: '42000’, index: 0 }

代码:

urllib.request(imges[i].url,{method:'GET',dataType:Buffer},function (err, imgdata, res){
    if(!err){

      
      Db.query('insert into table1(weat_guid,weat_join,weat_jointyle,weat_tyle,weat_blob) values(?,?,0,0,?)',
               [myguid,comguid,imgdata],function(err){ !err|| console.log(err)});  
    }
    else{
      console.log(err); 
    }
  });
};
回到顶部