title: How to build complex delete query in zend framework 2
body: <p>I have a class which is an instance of Zend TableGateway and I'm trying to build following delete query (where :start, :channel and :stop are variables)</p>
  
  <pre><code> DELETE FROM epg WHERE (epg_start &gt;= '2013-11-30 11:00:00') and FROM_UNIXTIME(UNIX_TIMESTAMP(epg_start) + epg_duration) &lt;= '2013-12-01 01:30:00') AND epg_service = 'skytv' AND epg_channel = '4music'
  </code></pre>
  
  <p>Here is what I have tried so far</p>
  
  <pre><code>$where = new Where();  
  $where-&gt;lessThanOrEqualTo(      
          'FROM_UNIXTIME(UNIX_TIMESTAMP(epg_start) + epg_duration)', '2013-12-01 01:30:00'  
      )
      -&gt;greaterThanOrEqualTo('epg_start', '2013-11-30 11:00:00')
      -&gt;equalTo('epg_service', 'skytv')
      -&gt;equalTo('epg_channel', '4music'); 
  $this-&gt;delete($where);
  </code></pre>
  
  <p>...and I get following error</p>
  
  <pre><code>Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`+` `epg_duration``)` &lt;= '2013-12-01 00:28:10' AND `epg_start` &gt;= '2013-12-01 00'
  </code></pre>
  
  <p>I have tried using Zend Expression class but I get error</p>
  
  <p><code>preg_split() expects parameter 2 to be string, object given</code></p>
  
  <p>Can anyone give me suggestion/example of how I can build this query using "Where" class</p>
  
  <p>Thanks in advance</p>