POST传值存到数组里数组存到session里或POST传值 直接以数组方式 存到session里(代码??)大概的意思是这样A--POST传值---》B 数组方式 存到session 再跳会AA--再POST传值---》B 数组方式 存到session 

解决方案 »

  1.   

    POST 每次传的值都是 数字 
      

  2.   

    session已是全局的,为何还要POST传值?
    你是要什么作用
      

  3.   

    你这两种方式都可以呀!
    sesseion也可以存数组!
      

  4.   


    A页面输出一个选择题  传过去的是一个答案的值 (数字)
    B页面上接受之后 查询他的所属的问题编号 
    把编号存到session里 再跳会A页面上 再输出
    一个选择题 输出的时候 查询要输出的选择题 
    是不是已经出过 这个时候要判断 ZID !==  session值
      

  5.   

    $a = $_POST['a']; // 这样就可以了$_SESSION['a'][] = $a; // 数组保存到 session 里
      

  6.   


    好不容易来了位高手啊请教一下 查询            表  条件  编号       编号不等于$_SESSION['a'][]里的编号 随机输出一道题
    select * from b where  id   and id!==$_SESSION['a'][] order by  rand()  limit 1判断的时候 可以直接判断 id!==$_SESSION['a'][] 吗??
      

  7.   

    $_SESSION['题号id'] = array('1','3','4');//哪个题号,选了哪几个选项
      

  8.   

    $sql = "select ...from .. where id not in(".implode(',',$_SESSION['a']).")";
      

  9.   

    请问后面加一句是不是这样写啊??
    $sql = "select ...from .. where id not in(".implode(',',$_SESSION['a']).")order by rand()  limit 1";出错误信息Warning: implode() [function.implode]: Invalid arguments passed in
      

  10.   

    Warning: implode() [function.implode]: Invalid arguments passed in
    ============================================
    先确认你的$_SESSION['a']是否存储了数组数据//print_r($_SESSION['a']);确保有值且为数组。
    $ids = $_SESSION['a'];
    $sql = "select ...from .. where id not in(".implode(',',(array)$ids).") order by rand()  limit 1"; 
      

  11.   


    请帮我看下代码if($_SESSION['a']!=="")
    {
      $query="select * from zyb where zid not in(".implode(',',$_SESSION['a']).")
       order  by rand()  limit 1";
    }
    else if($_SESSION['a']=="")
    {
    $query="select * from zyb where zid  order by  zid asc   limit 1";
    }
      

  12.   


    请帮我看下代码    如果SESSION数组里有值的话
    if($_SESSION['a']!=="") 
    {         查询         到  表  如果   ID   不存在 ()里 就 随机输出一道题
      $query="select * from zyb where zid not in(".implode(',',$_SESSION['a']).") 
      order  by rand()  limit 1"; 
    }    如果SESSION数组里没值的话
    else if($_SESSION['a']=="") 
    {                            随机输出一道题
    $query="select * from zyb where zid  order by  zid asc  limit 1";