Hi there!
I try to build an ExpressionEngine plugin, but I figured out, that the $DB class stops pulling content, if there are more than (in my case: 967) entries. I created a new table in my EE database. This table contains several information which are imported from an older system. There are now about 7600 rows in there. My plugin looks like this:
<?php
$plugin_info = array(
'pi_name' => 'Test',
'pi_version' => '1.0',
'pi_author' => 'Toby Sommer',
'pi_description' => 'LIMIT',
'pi_usage' => ''
);
class My_plugin
{
private $_sql;
public function __construct()
{
$this->_sql = "SELECT * FROM _misc_data";
}
public function test()
{
global $DB;
$query = $DB->query($this->_sql);
$id = array();
if ($query->num_rows > 0)
{
foreach ($query->result as $row)
{
$id[] = $row['id'];
}
}
return utf8_encode(implode(', ', $id));
}
/* END */
}
// END CLASS
?>
I also created a “one line template” inside a template group named “export”:
{exp:{segment_2}:{segment_3}}
And I call this template with: “http://mysite/export/my_plugin/test/”
But nothing returns. Just a blank page.
So I tried to add a “LIMIT 0, 10” to my $_sql variable and it just works. After playing around with the limit, 967 was the highest one. 968 and above does not work.
I really don’t see there a problem? Or do I have to tell EE, that I use a DB table which is “unknown” to it? Do I have to acquaint my DB table with EE?
Thanks for the help!
Toby,
I am going to move this to the Plugin Technical Assistance forum for you
For that blank page after setting your limit to 967 entries, lets try and get some sort fo error reporting going on. Cuuld be a resource exhausted
Thank you very much for the wiki link… I tried to put the error_reporting inside the template =)
Anyway… it says: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 607904 bytes) in /Users/toby/Projects/ee/system/db/db.mysql.php on line 411
PS: This error occurs even if I put the PHP inside a template. This is why I posted it into the tech support 😉
Toby,
Your php memory is rather low. Can you try upping that?
Another wiki link for you 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.