Thank you everyone. I changed the sql to:
SELECT * FROM events AS Event, pages AS Page
WHERE
Page.id=Event.page_id AND (
(Page.url LIKE '{$this->pageInformation['url']}%' AND
Event.show_on_parent_pages=1) OR
(Page.url='{$this->pageInformation['url']}'
He's expecting more than just 1 record though.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send em
Not sure what you were expecting, but the structure of that result set
looks correct. FYI, Model::findBySql() has been deprecated in favor of
Model::query().
Also note that it would be very simple to convert the above to a proper
Cake findAll query by creating a relationship between Event and Pa
I set the debug to 2 and it looks ok. I run it in SQLyog (like
phpmyadmin) and it returns 2 rows.
The array that is returned in cake is:
Array
(
[0] => Array
(
[Event] => Array
(
[id] => 2
[page_id] => 2
Set debug to 2 to see what your query looks like.
If you query looks good, copy the query that debug displays and run in
phpmyadmin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this
I am using version 0.10.9.2378_final and am trying to run
$this->set('events',
$this->Event->findBySql("SELECT * FROM events AS Event, pages AS
Page
WHERE
Page.id=Event.page_id AND (
(Page.url LIKE '{$this->pageInformation['url']}' AND
Event.show_on_pa