首页 > CMS > 帝国Empire > 正文

php 帝国cms 手记

2024-08-30 19:07:14
字体:
来源:转载
供稿:网友

$tt=$empire->fetch1(“select * from {$dbtbpre}ems_news where title=”.$writer.””);

如果$writer为中文字符,mysql会报错

1
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 '/xC2/xB7R/xC2/xB7/xE8/x95/xBE/xE6/xA0/xB9' at line 1

解决办法:在双引号外加上单引号

1
'".$writer."'
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表