把mysql_query("set names 'utf8'");放在操作数据库之前,基本可以解决编码问题。(数据库用UTF-8编码) 转载于:https://www.cnblogs.com/justforfun/archive/2009/04/27/1444351.html