解决方案 »

  1.   

    php 不能接受这样的表单元素(重名且不是数组形式)                <label for="from">时间:从</label>
                    <input type="text" name="date_out" id="from"/>
                    <label for="to">到</label>
                    <input type="text" name="date_out" id="to"/>
      

  2.   

    你的搜索条件好像和user表没有关系吧。最多就是“最近认领人”存的是user的id的话,就用下表连接join。
      

  3.   

    像这种需要你去定义,可以才用post表单也可以才用get表单,还可以才用ajax很多方法,但是都需要配合后台的PHP去定义使用。
      

  4.   

    我把这段代码改成了这个
     <label for="from">时间:从</label>
                    <input type="text" name="date_begin" id="from"/>
                    <label for="to">到</label>
                    <input type="text" name="date_end" id="to"/>
    在写sql语句里面改了
    sql = "select * from user  where  goods_types like ( '%".$_POST['goods_types']."%') or types like ('%".$_POST['types']."%') or (date_out > date_begin AND date_out < date_end)";对吗?感觉怪怪的,结果也不出来
      

  5.   

    if($_POST['goods_types'] != 'type') $w[] = "goods_types like  '%{$_POST['goods_types']}%'";
    if($_POST['types'] != 'types') $w[] = " types like '%{$_POST['types']}%'";
    $w[2] = '(' . ($_POST['date_begin'] != '' ? "date_out > '{$_POST['date_begin']}' : '000-00-00'); 
    $w[2] .= ' and '. ($_POST['date_end'] != '' ? "date_out < '{$_POST['date_end']}'" : now()) . ')';
    $w = join(' or ', $w);
    $sql = "select * from user  where $w";
    或 起来好像不对吧?