gpt4 book ai didi

php - 如何在 Symfony 2 中运行纯 mysql 查询?

转载 作者:行者123 更新时间:2023-11-29 00:40:26 26 4
gpt4 key购买 nike

如何在 Symfony 2 中运行纯 mysql 查询,就像这样:

$query = $this->db->run('select * from table');
$rs = $this->db->fetchAll($query);

foreach($rs as $r) {
...
}

最佳答案

这里用一些例子很好地解释了如何做到这一点:

http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/native-sql.html

关于php - 如何在 Symfony 2 中运行纯 mysql 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12492013/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com