<input type="checkbox" name="CBage" id="cbage2" value="and age >= 18 and age <= 24" checked/><label for="cbage2">18-24</label>
值= “和年龄> = 18和年龄< = 24”
在PHP后动作(我已经尝试)后
$age1 = $_POST['CBage'];
$age = mysql_real_escape_string(implode(",", $age1));
或
$age = implode(",", $age1);
表作为
CREATE TABLE `jobs` (
`age` varchar(200) COLLATE utf8_unicode_ci
)ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
在MySQL创建它插入作为
INSERT INTO jobs VALUES ('$age')
插入作为该值如下
and age = 18 and age,and age = 25 and age,
的问题是,它不正确插入的值(其缺少> <和一些文字在最后)
"and age >= 18 and age <= 24" but rather it inserted as "and age = 18 and age,and age = 25 and age,"
的(http://stackoverflow.com/questions/2843849/mysql-real-escape-more-than-once)尝试使用ヶ辆() –
没有它不是”可能重复t错过了那些角色;你看着网页浏览器中的值,它将它们视为HTML标记中的特殊字符....做一个“查看源代码”来查看数据库中真正检索的内容 –
确定首先,使用mysql_代替使用PDO或MYSQLI。尝试粘贴一个完整的代码,以帮助更好地了解您的问题 –