车站(科室):<input type="text" name="$_POST[station]">&nbsp;
姓名:<input type="text" name="$_POST[worker_name]">&nbsp;改为:车站(科室):<input type="text" name="station">&nbsp;
姓名:<input type="text" name="worker_name">&nbsp;将以下两行注释删掉。
//$station = $_POST['station'];
//$worker_name = $_POST['worker_name']; if里面的判断等号是两个等号 ==  这样改了之后,还有错误提示的话请贴出错误信息。

解决方案 »

  1.   

    PHP在文本输入框添加搜索内容查询数据表中的相关内容示例
    //输入框查询设置
    <table width="140" border="1">
      <form name="form1" method="post" action="sou_suo_ok.php?class=搜索引擎&&content=<?php echo $_GET[content];?>">
        <tr>
          <td>查询条件:姓名-科室-时间</td>
        </tr>
        <tr>
          <td><input name="tb_send_subject_content" type="text" size="25"/></td>
        </tr>
        <tr>
          <td><input type="submit" name="Submit" value="搜索引擎" onclick="return check_submit();" />
          </td>
        </tr>
      </form>
    </table>
    //查询页面显示设置
    <?php
    //获取帖子的类型 //获取帖子的类别
    //从发布的帖子中查询
    $query_6=mysql_query("select * from tb_photo where picname like '%$tb_send_subject_content%' or upname like '%$tb_send_subject_content%' or uptime like '%$tb_send_subject_content%'");
    //从回复的帖子中搜索
    //统计查询的结果
    if(mysql_num_rows($query_6)){
    if($page){ //定义分页的变量
         $page_size=6;
    $number=0; //定义每页显示的数量
         $query="select count(*) as total from tb_photo where picname like '%$tb_send_subject_content%' or upname like '%$tb_send_subject_content%'or uptime like '%$tb_send_subject_content%'";
    $result=mysql_query($query);
         $message_count=mysql_result($result,0,"total");
         $page_count=ceil($message_count/$page_size);
         $offset=($page-1)*$page_size;
    $query_2=mysql_query("select * from tb_photo where picname like '%$tb_send_subject_content%' or upname like '%$tb_send_subject_content%' or uptime like '%$tb_send_subject_content%' limit $offset, $page_size");
    while($myrow_2=mysql_fetch_array($query_2)){
    if(($number % 4) == 0){//codego.net/tags/4/1/
    ?>
    <tr>
    <?php
    }
    ?>
    <td colspan="2" align="center">
    <table width="260" height="120" border="1">
      <tr>
        <td width="117" rowspan="6"><img src="<?php echo $myrow_2[picpath];?>" width="140" height="120" /></td>
        <td width="140" style="font-size:12px"><span class="STYLE2">图片名称</span></td>
      </tr>
      <tr>
        <td width="120" height="20" style="font-size:12px"><a href="send_forum_content.php?up_id=<?php echo $myrow_2[up_id];?>" target="_blank"><?php echo $myrow_2[picname];?></a> </td>
      </tr>
      <tr>
        <td width="120" height="20" style="font-size:12px">创建人</td>
      </tr>
      <tr>
        <td width="120" height="20" style="font-size:12px"><?php echo $myrow_2[upname];?></td>
      </tr>
      <tr>
        <td width="120" height="20" style="font_size:12px">创建时间</td>
      </tr>
      <tr>
        <td width="120" height="20" style="font-size:12px"><?php echo $myrow_2[uptime];?></td>
      </tr>
    </table>
     <?php  
     $number++;
    }
    ?>
    </tr>
    </td>
    <?php
    }
    ?>
      

  2.   

    //$sql = "SELECT * FROM `leave_leader` ORDER BY station ASC , worker_name ASC , leave_reason, leave_date DESC";上面有條件判斷,但所有條件都不成立的時候,你需要有一個默認的sql。
    而你卻注釋了,把注釋去掉就可以了。
      

  3.   

    //$sql = "SELECT * FROM `leave_leader` ORDER BY station ASC , worker_name ASC , leave_reason, leave_date DESC";$sql没有初始值