- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有谁知道调试 NotORM 请求的方法吗?
我能够通过打印 NotORM 对象来获取它执行的 SQL 查询。
例子:
$models = $this->dbh->wh_product()->select("wh_model.id, wh_model.manufacturer, wh_model.model, wh_model.details, wh_model.wh_category.category, crm_contact.ragione")->order("wh_model.wh_category.id ASC, crm_contact.ragione ASC, wh_model.model ASC");
printf($models);
这给出:
SELECT
wh_model.id,
wh_model.manufacturer,
wh_model.model,
wh_model.details,
wh_category.category,
crm_contact.ragione
FROM
wh_product
LEFT JOIN wh_model ON wh_product.wh_model_id = wh_model.id
LEFT JOIN wh_category ON wh_model.wh_category_id = wh_category.id
LEFT JOIN crm_contact ON wh_product.crm_contact_id = crm_contact.id
ORDER BY
wh_category.id ASC,
crm_contact.ragione ASC,
wh_model.model ASC
我在查询时遇到问题,因为如果我通过 phpMyAdmin 手动执行此查询,我会得到大约 90 个结果,但 NotORM 只给我 14 个。
有没有办法了解 NotORM 发生了什么?
谢谢
最佳答案
我遇到了 iterator_to_array 弄乱结果集的问题。就我而言,我正在使用
查看结果集print_r(iterator_to_array($notormresult));
订单被忽略了。
我在实际迭代并打印结果集时注意到了这一点:
$newresult = array();
foreach($notormresult as $r){$newresult[]=iterator_to_array($r);}
print_r($newresult);
不确定这是否是您的问题,因为您的计数不匹配。
关于mysql - 如何调试 NotORM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36742827/
有谁知道调试 NotORM 请求的方法吗? 我能够通过打印 NotORM 对象来获取它执行的 SQL 查询。 例子: $models = $this->dbh->wh_product()->selec
我正在查看这个名为 NotORM 的 PHP 数据库库在阅读其文档后,我了解了它对连接的立场。争论的焦点基本上是使用连接的单个 SQL 查询与使用多个选择查询然后在数据库抽象层中交叉引用结果的性能。
我正在尝试使用 NOTORM 库更新单个记录。我有一个用户 ID,需要更新密码列。我找不到任何仅更新一条记录的代码示例。这是现在的代码,它不起作用,它会更新每条记录,而不是仅更新具有正确用户 ID 的
我正在学习 NotORM 来为学校制作一个简单的系统。我希望能够将“ promise ”授予“学生”。这是我的数据结构: 我的表: 学生 -studentid (PK)-名-姓-出生日期-vmg-年级
我的 MySQL 表如下所示: 'id' 'name' 'type' 1 name1 A 2 name2
刚开始使用Slim框架+NotORM_,需要做以下工作: SELECT * FROM Users WHERE name LIKE '%$value%'" 在 Slim 中,我可以使用 选择完全匹配的行
我正在使用 NotOrm 库来处理数据库中的数据。我必须按照此处的说明进行操作 http://www.sitepoint.com/database-interaction-made-easy-with
我需要使用 NotORM 最后插入的行 $res=array("firstname"=>"fname","lastname"=>"lname"); $result = $db->Product()->
我正在调试一个在 PHP 5.4 上使用 Slim 和 NotORM 的项目。将 NotORM 设置为 Debug模式时,NotORM 跟踪语句: fwrite(STDERR, "$backtrace
我是一名优秀的程序员,十分优秀!