$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."' |
新闻热点
疑难解答