sql-order-by - fatfreeframework 使用 order by 和 $option 参数

标签 sql-order-by fat-free-framework

我到处寻找这样做的例子,但无法弄清楚。 API 引用页面显示了这一点

array(
    'order' => string $orderClause,
    'group' => string $groupClause,
    'limit' => integer $limit,
    'offset' => integer $offset
    )

但是我到底如何在代码中实现它呢?我已经尝试过以下方法,但它不起作用。我喜欢无脂,但有时医生感觉体重有点轻。

$this->load(array('reportname=? ', $reportname, 'order' => 'rundate desc', 'limit' => 1));

最佳答案

我盯着文档看了又看,终于明白了这一点。希望它能帮助别人。

$this->load(
  array('reportname=? ', $reportname),
  array( 'order' => 'rundate desc', 'limit' => 1)
);

关于sql-order-by - fatfreeframework 使用 order by 和 $option 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41621181/

相关文章:

mysql - mysql 中的自定义排序

php - F3 (Fat-Free PHP framework) 并向其添加 MVC/OOP 结构

PHP Fat Free "set"带闭包

PHP - Fat Free Framework - 子文件夹中的命名 URL 路由 - 404

routing - 获取有关在 Fat Free v3 中执行的路线的信息

mysql - 保留 IN 子查询的排序

sql-server - SQL Server : ORDER BY in subquery with UNION

mysql - 非平凡表达式的排序结果

javascript - Fat-Free Framework 和 Abide AJAX 表单提交不起作用

mysql - 按特定顺序从数据库中提取行(不使用 ORDER BY)