使用colleciton->getSelectSql()输出运行的SQL语句
magento获取SQL语句的另外一种方法是设置打印SQL为true
$collection = Mage::getModel('catalog/category')->getCollection();
echo $collection->getSelectSql(true);
$collection->getSelectSql()->__toString();magento获取SQL语句的另外一种方法是设置打印SQL为true
$collection=Mage::getResourceModel('reports/product_collection');
$collection->printlogquery(true);
本文详细介绍了在Magento框架中使用多种方式获取SQL语句的方法,包括使用`getSelectSql()`函数和设置打印SQL为true。通过这些方法,开发者可以更深入地理解Magento的查询过程。
1566

被折叠的 条评论
为什么被折叠?



