我用phpcms v9 查询数据库得到了数据 但是这个数据是一个对象 我要怎么判断这个数据有没有
代码如下$gonghao=$_POST['gonghao'];echo$gonghao;$sql4="select*fromgw_team_dataleftjoingw_...
代码如下
$gonghao = $_POST['gonghao'];
echo $gonghao;
$sql4 = "select * from gw_team_data left join gw_team on gw_team_data.id = gw_team.id where gw_team_data.gonghao = '$gonghao'";
$datas = $this->team->query($sql4);
//print_r($datas);
print_r(mysql_result($datas,0));
if($datas){
echo "11111111";
}else{
echo "22222222";
} 展开
$gonghao = $_POST['gonghao'];
echo $gonghao;
$sql4 = "select * from gw_team_data left join gw_team on gw_team_data.id = gw_team.id where gw_team_data.gonghao = '$gonghao'";
$datas = $this->team->query($sql4);
//print_r($datas);
print_r(mysql_result($datas,0));
if($datas){
echo "11111111";
}else{
echo "22222222";
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询