Home >Backend Development >PHP Tutorial >PHPMaker7 cannot get the value when editing in Chinese_PHP tutorial
01
*************************** 1. row ********************* *******
02
Table: zone_allow
03
Create Table: CREATE TABLE `zone_allow` (
04
`id` int(11) NOT NULL AUTO_INCREMENT,
05
`spcode` varchar(30) NOT NULL DEFAULT '',
06
`region` varchar(255) NOT NULL DEFAULT '',
07
`type` varchar(30) NOT NULL DEFAULT '',
08
`total` int(11) NOT NULL,
09
`status` int(2) NOT NULL DEFAULT '1',
10
`logtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
11
PRIMARY KEY (`id`)
12
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=gbk
If the field region content is in Chinese, click Edit in the generated CRUD code and the field content will not be displayed.
Open phpfn7.php to find the function ew_HtmlEncode
1
function ew_HtmlEncode($exp) {
2
return htmlspecialchars(strval($exp));
3
}
Modify this function
1
function ew_HtmlEncode($exp) {
2
return htmlspecialchars(strval($exp), ENT_COMPAT, "GB2312");
3
}
Save the test and the problem is solved.