我需要按准则2查询生成器应用此查询:
INSERT INTO orders
(status_id, menu_id, daily_balance_id)
VALUES
(1, 2, (SELECT id FROM daily_balances WHERE end_time IS NULL));
有什么帮助吗?!
答案 0 :(得分:0)
也许是吗?
$em = $this->getDoctrine()->getManager();
$RAW_QUERY = "INSERT INTO orders
(status_id, menu_id, daily_balance_id)VALUES(1, 2, (SELECT id FROM daily_balances WHERE end_time IS NULL));";
$statement = $em->getConnection()->prepare($RAW_QUERY);
$statement->execute();
$qua = $statement->fetchAll();