I have a very simple db_query. I want to look for any node created between two timestamps.
This query works fine in MySQL shell
SELECT nid as id,created as start,title FROM node WHERE created BETWEEN '1403564400' AND '1403650800';
This works fine in Drupal
$data = db_query("SELECT nid as id,created as start,title FROM node")->fetchAll();
echo json_encode($data);
As soon as I add in the BETWEEN conditions below I get an Internal Server Error.
$data = db_query("SELECT nid as id,created as start,title FROM node WHERE created BETWEEN '1403564400' AND '1403650800'")->fetchAll();
I am unsure what I am doing wrong here, perhaps someone can point me in the right direction please!