php+MYSQL提交表单查询问题
我这段代码,连接数据库正常,在PHPMYADMIN上执行查询没问题,通过提交表单来查询数据库,就不能查询出结果,寻求大侠帮助!<?phpinclude('conn.php...
我这段代码,连接数据库正常,在PHPMYADMIN上执行查询没问题,通过提交表单来查询数据库,就不能查询出结果,寻求大侠帮助!
<?php
include('conn.php');
?>
<form name="form1" method="post" action="#">
<input type="hidden" name="tag" size="4" value="1">毕业证编号
<input type="text" name="bianhao" size="10" value="<?php echo $bianhao;?>">
<input type="submit" name="Submit" value="查询">
<input type="reset" name="Submit2" value="重新输入">
</form>
<?php
$bianhao=$_POST["bianhao"];
if($bianhao!=""){
$byzbh=$bianhao;
}
?>
<?php
$a=($page-1)*$page_size;
mysql_query('set names gb2312');
$query=mysql_query('SELECT * FROM zhengshu WHERE byzbh=$byzbh');
while($rs=mysql_fetch_object($query))
{
?>
<table class="itable" width="98%" border="0" cellspacing="0" background="images/bg_line.gif"
tppabs="/wish/images/bg_line.gif">
<tr height="20">
<td width="5%"> 序列号</td>
<td width="10%"> 姓名</td>
<td width="5%"> 性别</td>
<td width="10%"> 毕业日期</td>
<td width="10%"> 毕业学校</td>
<td width="10%"> 专业</td>
<td width="10%"> 毕业证编号</td>
<td width="10%"> 身份证编号</td>
</tr>
<tr>
<td width="10%"><?=$rs->id?></td>
<td width="10%"><?=$rs->name?></td>
<td width="5%"><?=$rs->sex?></td>
<td width="10%"><?=$rs->bydate?></td>
<td width="10%"><?=$rs->byxx?></td>
<td width="10%"><?=$rs->zhuanye?></td>
<td width="10%"><?=$rs->byzbh?></td>
<td width="10%"><?=$rs->sfzh?></td>
</tr>
</table>
<div align="center">
<?
}
?> 展开
<?php
include('conn.php');
?>
<form name="form1" method="post" action="#">
<input type="hidden" name="tag" size="4" value="1">毕业证编号
<input type="text" name="bianhao" size="10" value="<?php echo $bianhao;?>">
<input type="submit" name="Submit" value="查询">
<input type="reset" name="Submit2" value="重新输入">
</form>
<?php
$bianhao=$_POST["bianhao"];
if($bianhao!=""){
$byzbh=$bianhao;
}
?>
<?php
$a=($page-1)*$page_size;
mysql_query('set names gb2312');
$query=mysql_query('SELECT * FROM zhengshu WHERE byzbh=$byzbh');
while($rs=mysql_fetch_object($query))
{
?>
<table class="itable" width="98%" border="0" cellspacing="0" background="images/bg_line.gif"
tppabs="/wish/images/bg_line.gif">
<tr height="20">
<td width="5%"> 序列号</td>
<td width="10%"> 姓名</td>
<td width="5%"> 性别</td>
<td width="10%"> 毕业日期</td>
<td width="10%"> 毕业学校</td>
<td width="10%"> 专业</td>
<td width="10%"> 毕业证编号</td>
<td width="10%"> 身份证编号</td>
</tr>
<tr>
<td width="10%"><?=$rs->id?></td>
<td width="10%"><?=$rs->name?></td>
<td width="5%"><?=$rs->sex?></td>
<td width="10%"><?=$rs->bydate?></td>
<td width="10%"><?=$rs->byxx?></td>
<td width="10%"><?=$rs->zhuanye?></td>
<td width="10%"><?=$rs->byzbh?></td>
<td width="10%"><?=$rs->sfzh?></td>
</tr>
</table>
<div align="center">
<?
}
?> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询