如何将爆炸值与用户会话ID匹配?

时间:2016-03-05 09:12:41

标签: php mysql sql

<?php while($row=mysql_fetch_array($res)) { 

     $imp_to=explode(',',$row['mail_to_user_id']);

     $imp_cc=explode(',',$row['mail_cc_user_id']);

if($imp_to == $_SESSION['user_id'] or $imp_cc == $_SESSION['user_id'] )
    {

    }

1 个答案:

答案 0 :(得分:0)

尝试这样..

<?php while($row=mysql_fetch_array($res)) { 

     $imp_to=explode(',',$row['mail_to_user_id']);

     $imp_cc=explode(',',$row['mail_cc_user_id']);

    if(in_array($_SESSION['user_id'] ,$imp_to) || in_array($_SESSION['user_id'] ,$imp_cc))
    {

    }