如何让数组中多个成员,匹配MYSQL单字段里的一篇文章。
例如
数组:
$arr=array('tom','cat','jam','tim','bim');
tom,cat,tony,girl
jam,tim,bim
jam,tom
tool,wood,boy,cat
$sql = 'create temporary table T ';<br />foreach($arr as $i=>$v) {<br /> $sql .= $i ? "union select '$v' " : "select '$v as name ";<br />}<br />mysql_query($sql); //创建临时表<br /><br />$sql = "select * from tbl_name, T where find_in_set(T.name, tbl_name.field)";<br />$rs = mysql_query($sql); //查询<br />