php - ORM 和 php 过滤掉数据库中的日期

标签 php mysql orm

如果我在我的 php 文件中编写这个 ORM 查询,我会取回日期为“2000-01-01”的所有项目,但是如何取回所有日期为“2000-01-01”的项目以上?我试过了,但没有用...

注意:数据库中的所有日期都是这种格式:yyyy-mm-dd

$results = ORM::for_table('my_table')
            ->where('slug', "slug_name")
            ->where('date', 'date'>="2000-01-01")
            ->find_array(); 

最佳答案

看起来像它的习语

http://idiorm.readthedocs.org/en/latest/querying.html#less-than-greater-than-where-lt-where-gt-where-lte-where-gte

并且从文档中查询构建器应该是

$results = ORM::for_table('my_table')
            ->where('slug', "slug_name")
            ->where_gte('date', "2000-01-01")
            ->find_array(); 

关于php - ORM 和 php 过滤掉数据库中的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29154267/

相关文章:

php - shell_exec() 如何选择使用哪个 shell?

mysql用if语句连接三个表

php - 如何将 blob 数据(不是图像)从 mysql 输出到 php?

java - 建模 "specific products"数据库

c# - ORM 是否有任何方法可以确定 SQLite 列包含日期时间或 bool 值?

.net - ADO.NET Entity Framework 的实际好处是什么?

PHP 检索特定列索引结果的约定?

php - Symfony2 项目中基于 Doctrine 的认证机制

php - 如何从 AFNETWORKING POST 获取参数

mysql - 计算mysql最大连接数限制