的MySQL
select max(PARAM_DATE) from access_param;
ZF2
$em = $this->getEntityManager();
$pp = $em->createQuery("select max(pdate) as date1 from Access\Entity\Param B");
$user2 = $pp->getResult();
$q =$em->createQuery"selectB.pdate,B.userid,B.pdate,B.password,B.uppercase,B.useridspecial,B.number from Access\Entity\Param B where B.pdate='".$user2."' " );
$user1 = $q->getResult();
答案 0 :(得分:0)
最后我得到了输出,我认为它对初学者使用实体管理器很有用
$pp = $em->createQuery("select max(B.pdate) as date1 from Access\Entity\Param B");
$user2 = $pp->getResult();
foreach($user2 as $user2) {
$pdate=$user2['date1'];
}
$_POST['pdate']=$pdate;
$q = $em->createQuery("SELECT
B.pdate, B.userid, B.pdate, B.password,
B.uppercase, B.useridspecial, B.number
FROM Access\Entity\Param B
WHERE B.pdate='".$_POST['pdate']."'");