douyun6781 2014-06-14 15:08
浏览 31
已采纳

Zend Framework 2:TableGateway

I am using the TableGateway from Zend Framework 2. My problem is that I cannot get the between function to work.

This is my code that I have for now, the output is just nothing:

public function fetchBetween($startDate, $endDate)
{
    $where = new Where();
    $where->between('date', $startDate, $endDate);

    $resultSet = $this->tableGateway->select($where);
    return $resultSet;
}

I am calling this function to get the date between two dates.

$this->getCalendarTable()->fetchBetween('4-04-2014', '30-05-2014');

PHPMyadmin table

This is the query that it has to be and in phpmyadmin it is giving back data so there is nothing wrong with the query or the databank:

SELECT * FROM `klj_agenda` WHERE date BETWEEN '1-05-2014' AND '30-05-2014'
  • 写回答

2条回答 默认 最新

  • douhao7889 2014-06-15 10:54
    关注

    The problem was the query: 2014-05-01 instead of 01-05-2014

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 数字取证课程 关于FAT文件系统的操作
  • ¥15 如何使用js实现打印时每页设置统一的标题
  • ¥15 安装TIA PortalV15.1报错
  • ¥15 能把水桶搬到饮水机的机械设计
  • ¥15 Android Studio中如何把H5逻辑放在Assets 文件夹中以实现将h5代码打包为apk
  • ¥15 使用小程序wx.createWebAudioContext()开发节拍器
  • ¥15 关于#爬虫#的问题:请问HMDB代谢物爬虫的那个工具可以提供一下吗
  • ¥15 vue3+electron打包获取本地视频属性,文件夹里面有ffprobe.exe 文件还会报错这是什么原因呢?
  • ¥20 用51单片机控制急停。
  • ¥15 孟德尔随机化结果不一致