对于这个问题,大家可以find_in_set函数,可以很好的解决。
$sql="select * from ".tablename('weh5app_bobing_records')." where weid=".$_W['uniacid'];
$sql_count="select count(*) from ".tablename('weh5app_bobing_records')." where weid={$_W['uniacid']}";
if(!empty($openid_str))
{
//$sql.=" and '".$openid_str."' like concat('%', openid, '%')";
//$sql_count=" and '".$openid_str."' like concat('%', openid, '%')";
$sql.=" and find_in_set(openid,'".$openid_str."')";
$sql_count.=" and find_in_set(openid,'".$openid_str."')";
}
正文完