中sql语句不能正常执行是怎么回事

//表单:<selectname="select"><optionvalue="id">员工ID</option><optionvalue="name"selected>... //表单:
<select name="select" >
<option value = "id" >员工ID</option>
<option value = "name" selected>姓名</option>
<option value = "decscription">部门</option>
</select>

//执行文件
$sele=$_POST["select"];echo $sele;
$cond=$_POST["text"];echo $cond;
if($sele=='id')
{
$query="select id,name,description from staff_info,depart_info where staff_info.depart_id=depart_info.depart_id and staff_info.id='".$cond."';;";
}
if($sele=='name')
{
$query="select id,name,description from staff_info,depart_info where staff_info.depart_id=depart_info.depart_id staff_info.name='".$cond."';";
}
else
{
$query="select id,name,description from staff_info,depart_info where staff_info.depart_id=depart_info.depart_id and depart_info.description='".$cond."';";
}

执行的记录集为空,为什么???
展开
 我来答
_Sunshow
2007-03-31 · 超过10用户采纳过TA的回答
知道答主
回答量:94
采纳率:0%
帮助的人:75万
展开全部
你把$sele和$cond两个变量输出看看是否正确接收到了表单提交的值
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式