Re: Re: [rgc] displaying tonights performing artist

2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 6, 2014   (RSS)

By gregThomas - March 6, 2014

Hi s2smedia, 

You can do this by adding a standard MySQL date time string your where statement. The format for the string should be:

<?php
  list($eventRecords, $eventMetaData) = getRecords(array(
    'tableName' => 'event', 
    'where' => " date >= NOW() ", 
  ));
?> 

This will send the full current date and time, for example:

2014-03-06 16:57:12

If you wanted to just use the current hour you could use:

<?php
  list($eventRecords, $eventMetaData) = getRecords(array(
    'tableName' => 'event', 
    'where' => " date >= '".date('Y-m-d H:00:00')."'", 
  ));
?> 

This uses the PHP function date to construct the time stamp, this would send a time stamp in this format:

2014-03-06 16:00:00

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com