I've got this code here that is running in a task
http://scrp.at/Vq
and it gives me this error
Error: Invalid argument supplied for foreach() in /Users/jon/Sites/.../fuel/packages/orm/classes/query.php on 119
Line 119 == Line 16 (in the scrap)
I have a feeling it is because I have a single result, so it doesn't have an array of results to loop over, but this is just an educated guess.
@Phil, that won't work - the 'first' arg can't be combined with the method chaining syntax.
@jondavidjon
I'm not sure what's wrong, but from the error I can deduce you're using RC2. This may have already been fixed in develop. On the other hand the error is occuring in the select() method, and as such maybe you didn't configure the properties right?
When you use 'first', 'last' or 'all' the options array is used and the query is executed immediately. When you don't use any of those (thus null) a query object is returned for you to finish.
Updated ORM package to the develop branch and it changed the error.
I'm now getting "zend_mm_heap corrupt"
Which all the googling I've done points to increasing the output buffer in my php.ini
But this seems strange for a task that doesn't even have any output.
Also, after reading through the php docs (which may or may not apply) it says that output buffering is always off for PHP-CLI
I know MAMP is a strange beast, but as I don't have a Mac, I can't help you any further.
I know though that PHP 5.3.2. wasn't the best of releases, so that might have something to do with it...