When you run a query like this, you're violating MVC practise. I'd
rather

$x = $model->find()
$x['Model']['field']++
$model->save($x)

To keep things were they're supposed to be, otherwise sometimes
queries are at the model, sometimes at controller, next thing you know
you're writing stored procedures; and that's a nightmare. Of course,
sometimes you need speed, so I'd
Write a method like wyrihaximus did.

On 18 jan, 07:55, WyriHaximus <[email protected]> wrote:
> Afaik not thats why I wrote this function for in my appModel a while
> ago:http://bin.cakephp.org/view/429049354
>
> On Jan 18, 2:52 am, Saleh Souzanchi <[email protected]> wrote:
>
> > Is there another way?
>
> > On Jan 18, 4:46 am, Jon Bennett <[email protected]> wrote:
>
> > > > how to execute this query with cakephp :
>
> > > > update table_name set hit = hit+1
>
> > > $this->Table->query('update table set hit = hit+1);
>
> > > j
>
> > > --
> > > jon bennett -www.jben.net-blog.jben.net
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to