I don’t know if this is a bug or what but when I do:
[tt] $datesTableName = $modx->getTableName(’amcCalDates’);
$sql = "SELECT date FROM $datesTableName where event_id=:event_id";
$query = new xPDOCriteria($modx, $sql, array(’event_id’=>$_GET[’event_id’]));
$dates = $modx->getCollection(’amcCalDates’,$query);[/tt]
I get:
[tt]Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 261900 bytes) in xpdoobject.class.php on line 866[/tt]
But if I do:
[tt] $datesTableName = $modx->getTableName(’amcCalDates’);
$sql = "SELECT * FROM $datesTableName where event_id=:event_id";
$query = new xPDOCriteria($modx, $sql, array(’event_id’=>$_GET[’event_id’]));
$dates = $modx->getCollection(’amcCalDates’,$query);[/tt]
I get the correct response. Note the change from date to * in the $sql.
Both queries work fine in phpMyAdmin. This is on Revo 2.0.0-pl using XAMPP on Windows 7 with php 5.3.0.
Any thoughts?
[tt](PS - before someone asks, the reason I’m using XPDOCriteria is because I actually want to do:
$sql = "SELECT min(date), max(date) FROM $datesTableName where event_id=:event_id";
which doesn’t work either.
)[/tt]
You need to select at least the primary key of the object you want to retrieve.
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com