Re: performance / traffic / .. -> one READ or few FIND calls?

2011-10-16 Thread cakii
alright, thank you guys !

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


performance / traffic / .. -> one READ or few FIND calls?

2011-10-12 Thread cakii
Hi everyone,

i start think bout performance, traffic, aweseom code etc.
i have a few *find *commands in my model, depending on the flow 3-6 'little' 
*finds*, sometimes *field *only.
depending on the request flow, in the worst case all data /finds is needed 
-> read equivalent

do you think its wiser, make one 'big' *read* (20 fields in one model and in 
correspondning model betwenn 5 and about 50 fields) *everytime *and using 
*model-> 
data *for further actions instead of the more or less find calls ?



..
another little question:

whats the best way to raise an int field in a database in cakephp, like:
UPDATE foo SET bar = bar+1 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: redirect and sessions not working

2011-10-11 Thread cakii


$this->find('first', array('conditions' => array('id'=>11), 'fields' => 
> array('ip1', 'ip2')));
> should work. 
> http://book.cakephp.org/2.0/en/models/retrieving-your-data.html?highlight=find%20first#find-first
>
> or
>
> $this->id = 11;
> $this->read(array('ip1', 'ip2'));
>
> yes, both works

>
> You are using UUIDs for table primary key, read 
> http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html?highlight=uuid#model-and-database-conventions
> but referring ID's as integer
>
yes, the int 11 is "old test data" but thats not the problem here, i just 
thought FIND hast the same functionalty READ has, regarding ids:
"By default, the currently selected record, as specified by Model::$id,"
but i was wrong sorry..

thank you very much!
i'll make a clean project later and hopefully get the other problems solved, 
thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: redirect and sessions not working

2011-10-11 Thread cakii
hmm, in my project just nothing happens, if i put my code in 
AppController::beforeFilter(), just an empty debug:
 *app\Controller\AppController.php* (line *14*)

for a clean app its enough to use latest download in another directory eg 
htdocs/test2, right ?!


in the meantime i had another strange problem:

call from CONTROLLER:
$this->Testmodel->id = "11";
$this->Testmodel->test();

MODEL:
$this->id = '11';
debug($this->find('first', array('fields' => array('ip1', 'ip2';

and the result from debug is:

[Testmodel] => Array
(
[ip1] => 1
[ip2] => 1
[id] => 0582ef53-f030-11e0-ad60-524e8fe2be12
)

but i though if i set id (i know, setting it one time - only in model or 
controller - SHOULD be enough..) id should not be generated, only if id is 
empty.
But id is set, if i debug it after the find call (the right one, 11 ..).
Of course there is data with id 11 in the database. 
The sql query from cakeph is : ... WHERE 1 = 1


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


redirect and sessions not working

2011-10-11 Thread cakii
i,

i have a few problems i can't solve ..

im using cake 2.0.0-RC3 and PHP Version 5.3.1
cake default layout , debug 2

in my controller i only have one simple line: (the corresponding view
is completly empty)

$this->redirect('http://http://www.cakephpforum.net/');


but nothing happens, just a white page.

same with:

$this->redirect(array('controller' => 'test', 'action' => 'view'));



also i cant get the sessions working.

i have this line in my appcontroller:

public $components = array('Session');

(is this line needed ? and/or anything else to use sessions? )

in my controller (extend appcontroller) the only 3 lines are:


echo $this->Session->check('lastVisit');
$this->Session->write('lastVisit', time());
echo $this->Session->check('lastVisit');
debug($this->Session->read());

--> no output just an empty cakephp layout without any content

any idea whats the problem ?


Thanks in advance..

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php