On Mon, Oct 27, 2008 at 11:36 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:
>
> hi all,
>
Hi.
>
> Just a few errors I found so far, if anyone can help, it would be much
> appreciated.
>
> 1. Having multiple conditions on find:
>
> post.php Model
> $this->find('all', array('conditions' => array('DATE(Post.date)' => '>
> '.$date, 'Date(Post.date)' => '< '.$end_date)));
>
> SQL generated:
> SELECT `Post`.`id`, `Post`.`name`, `Post`.`date`, `Post`.`content`,
> `Post`.`user_id`, `User`.`id`, `User`.`name`, `User`.`email`,
> `User`.`firstname`, `User`.`lastname` FROM `posts` AS `Post` LEFT JOIN
> `users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE
> DATE(`Post`.`date`) = '> 2008-01-01 00:00:00' AND Date(`Post`.`date`)
> = '< 2008-12-31 23:59:59'
>
> Results:
> None, but I know there are 2 results.
>
That's because the < and > signs should be in the array key, not value. Try
changing your conditions to something like this
array(
'conditions' => array(
'DATE(Post.date) >' => $date,
'DATE(Post.date) >' => $end_date
)
)
>
>
> 2. Htaccess issue?
>
> view.ctp for posts:
> <?=$ajax->form('/comments/add', 'post', array('update'=>'comments')); ?
> >
>
> Code generated for the form:
> action="/workspace/cake/posts/comments/add"
>
> Results:
> Should this not be:
> action="/workspace/cake/comments/add" ?
>
Try to set 'model' => 'comments' in the options array.
>
> Kind Regards,
> Martin
>
> >
Cheers,
Gabriel Gilini
www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---