如果像这样直接插入中文,可能在Mysql中会出现乱码 

$conn=@mysql_connect("localhost","root","") or die("链接错误");
mysql_select_db("newdb",$conn);

在这里插入这句,后面就可以正常插入中文了: mysql_query("SET NAMES 'GBK'");

$sqlstr="INSERT INTO test (id,uid,regdate,remark) values ('','钱二',now(),'工人')";
mysql_query($sqlstr,$conn) or die(mysql_error());

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2021-12-31
  • 2021-10-23
  • 2021-07-26
  • 2021-08-18
  • 2022-12-23
猜你喜欢
  • 2021-12-10
  • 2021-10-09
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
相关资源
相似解决方案