php if文msクエリが空であるか否かを判定する

1686 ワード

$select_re_id=$cnx->query("select count(*) c from Yid where pid='".$pid."' and gid='".$gid."' and prid='".$prid."' and cid='".$cid."' and did='".$did."'");//      

foreach($select_re_id as $reid){

if ($reid['c']=='0'){

$cnx->query("INSERT INTO Yid (pid,gid,prid,cid,did) VALUES ('".$pid."','".$gid."','".$prid."','".$cid."','".$did."')");//    

}else{

echo "       !";

}