从topics表中查询字段subject与传进来的参数’$_POST[‘topic’]进行比较模糊查询
设subject字段数据为:数学,英语,物理,化学,英文
$subject=$_POST[‘topic’];
$sql = “select * from topics where subject like ‘%” .$subject. “%'”;
$result = mysql_query($sql);
若从表单提交的‘topic’值为“学”,得到的结果将是:数学,化学
多个字段匹配查询:
$sql = “select id,subject from topics where (id like ‘%” .$id. “%’) or (name like ‘%” .$name. “%’) or (subject like ‘%” .$subject. “%’) order by id desc”;
结果依据字段id的顺序
进mysql,mysql查询并且更新,mysql不同字段求和,mysql一键清空,mysql cbo rbo,mysql select top 1php统计人数,linux查看php拓展,php开发培训课程,php异步执行shell脚本,php 获取当前时间月份,php正则替换斜杠,php5.5 x86 安装版,php工作贴吧,php一年日历