@whistlemaker: Well, 'date' is the name of the column of my custom db where the date is stored as Unix Timecode value and the field is type (int20).
I also worked again on Burno17 idea and I changed this
$classname = 'Headlines';
$date = strftime('%Y-%m-%d');
$query = $modx->newQuery($classname);
$query->where("DATE(" . $modx->escape($classname) . '.' . $modx->escape('publishedon') . ") = '" .$date."'", xPDOQuery::SQL_AND);
to this
$classname = 'Headlines';
$date = strftime('%Y-%m-%d');
$query = $modx->newQuery($classname);
// changed $modx->escape('date')
$query->where("DATE(" . $modx->escape($classname) . '.' . $modx->escape('date') . ") = '" .$date."'", xPDOQuery::SQL_AND);
because the column in the db where the date is stored as a Unix Timestamp is called "date".
The snippet now runs fine but it doesn't give me any records back so I still must be doing something wrong.
Maybe this line is wrong:
$date = strftime('%Y-%m-%d');
As far as I understand, there must be the date value from the resources publishedon content tag.
I try again to explain in detail, what I would like to do:
From a resource, I call a snippet. This snippet queries my custom db (called tb_headlines;classname is headlines). It should return all records that have the same date like the resources publishedon date value. The db field where the date is stored as a unix timestamp is called "date".
Any help is very much appreciated.
[ed. note: shotup last edited this post 14 years, 9 months ago.]