Hello. I am trying to use modx tables through xpdo with my snippet
$id=empty($id)?1:$id;
$c = $modx->newQuery('modTemplateVarResource');
$c->setClassAlias("v");
$c->leftJoin('modTemplateVar','t','v.tmplvarid=t.id');
$c->select("t.name,v.value");
$c->where(array("v.contentid"=>"$id"));
$modx->setDebug(true);
$t = $modx->getCollection('modTemplateVarResource',$c);
$modx->setDebug(false);
$placeholders['ttt']='';
//dummy output
foreach($t as $f)
{
$placeholders['ttt'].=$f->pagetitle;
}
$out = $modx->getChunk('123',$placeholders);
return $out;
And get a strange error. On virtual server I have "Segmentation Fault(11)", on my local computer I have "PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 261900 bytes) in /home/.../core/xpdo/om/xpdoobject.class.php on line 1530". As I can see both error are connected with xpdo or mysql client, but I cant figure out exactly. If I comment getCollection or change it to query without join I won’t get any errors.
My database contains 3 resources.
VPS configuration:
mysql: 5.1.58-1~dotdeb.0
PHP: 5.2.17-0.dotdeb.0
Mysql client api: 5.0.51a
Error message: "child pid 26493 exit signal Segmentation fault (11)"
local configuration
mysql 5.1.54-1ubuntu4
PHP: 5.3.5-1ubuntu7.2
MYSQL CLIENT API: 5.1.54
PDO: 5.1.54
Mem limit: 512 MB
Error message: "PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 261900 bytes) in /home/.../core/xpdo/om/xpdoobject.class.php on line 1530".
Can anybody help me?