【发布时间】:2014-01-06 15:36:34
【问题描述】:
我有一张桌子:sms_followers。我有 2 个实体:俱乐部和用户。我知道如何将数据插入表中,但我无法从中获取数据。谁能给我一些支持?
我想检查带有俱乐部 ID 的用户 ID 是否已经存在。
到目前为止我的代码:
$club = $this->em->getRepository('Club')->findBy(array('id' => $clubid));
$user = $this->em->getRepository('User')->findOneBy(array('id' => $this->auth->getUser()->getId()));
$notifiction = $user->getSmsfollower();
这样看:
$sql = 'SELECT userid, clubid FROM sms_followers WHERE clubid=value AND userid=value';
echo $row['clubid'];
echo $row['userid'];
【问题讨论】:
标签: php symfony doctrine-orm