Re: sql error 1054 unknown column in 'on clause'

2010-05-12 Thread Amit Rawat
No acknowledgement for me?

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 cake-php@googlegroups.com
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?hl=en


Re: sql error 1054 unknown column in 'on clause'

2010-05-12 Thread Ambika Kulkarni
Hi John,

That prblem got resolved as i changed the storetype model name to
store_type. And it worked.

Thanks for your kind concern

Thank you,

On Wed, May 12, 2010 at 8:28 PM, John Andersen wrote:

> I'll rephrase my question, can you show me the SQL description of the
> store_types table, like this:
> [code]
> CREATE TABLE `store_types` (
>`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
>`name` VARCHAR(40) NOT NULL,
>PRIMARY KEY (`id`)
> )
> [/code]
>
> I ask because I want to be sure that the table has a primary key named
> "store_type_id"!
>
> Another option is to try to leave out the fields parameter and see
> what you then get!
> Enjoy,
>   John
>
> On May 12, 7:38 am, Ambika Kulkarni 
> wrote:
> > In store_types tbl primary key is store_type_id
> >
> [snip]
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
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?hl=en


Re: Display Blob from db

2010-05-12 Thread Ed Propsner
Thanks Martin, it worked just fine.

It turns out that with all I have tried I was actually close.

$this->layout = 'ajax'
AND
Router::url

made all the difference in the world.

I nearly fell out of my chair when the image displayed :)

- Ed



On Wed, May 12, 2010 at 11:54 PM, Martin Radosta wrote:

>  An approach
>
> in the controller:
>
> function show_image($recordId) {
> $this->set('data', $this->Model->findById($recordId));
> $this->layout = 'ajax'
> }
>
>
> the view show_image.ctp:
>
> Configure::write('debug', 0);
> header("Content-type: image/jpeg"); //assume jpg image
> echo $data['Model']['blob_file'];
>
>
> your view:
>
> echo $html->tag('img', array(
> 'src' => Router::url(array('controller' => 'your_controller', 'action'
> => 'show_image', $userInfo['Photo'][0]['id']))
> )
> );
>
>
> Regards
>
> MARTIN
>
>
>
>
> On 05/13/2010 12:26 AM, Ed Propsner wrote:
>
> Besides the size there should be no diff between "binary" and "blob", I was
> just thinking that perhaps Cake handled them differently.
> I played around with media view and it doesn't seem to be what I'm looking
> for.
>
>  I have it narrowed down to the headers and I can get the photo to display
> but it has to be in it's own view and even then I have to echo the image
> directly in the controller action ... this isn't working for me. I never
> usually store photos directly to the database but in this instance i feel it
> better serves my purpose without taking a hit on performance.
>
>  Ideally I would like to access the image through it's $hasMany assoc and
> nest it in an image tag but I'm at a loss for how to pull that off with
> Cake.
>
>
>
> On Wed, May 12, 2010 at 3:12 PM, Ed Propsner  wrote:
>
>> I've been toying with this one for a while now and I'm not really getting
>> anywhere.
>>
>>  I'm trying to display a photo stored in db as type "blob". With
>> conventional PHP I would normally store the photo with type "binary" and
>> never had any issues ... Blob is not going so well.
>> I figure the problem has something to do with content type but MVC is
>> confusing me a bit when it comes to headers or media views. It seems
>> straightforward enough but I think I'm going about the wrong way (I'm not
>> using media view or headers at this point).
>>
>>  In my Users Model I set up a $hasMany assoc.
>>
>>   var $hasMany = array(
>> 'Photo' => array(
>> 'className' => 'Photo',
>> 'foreignKey'=> 'user_id',
>> 'conditions'=> array('Photo.profile' => 1, 'Photo.private'
>> => 0),
>> 'limit'=> '1',
>> 'dependent'=> true
>> )
>> );
>>
>>  Rendering the photo is the problem.
>>
>>  > View
>>
>>  $html->tag('img', array(
>>   'src' => $userInfo['Photo'][0]['file']
>>  )
>> )
>>
>>  the "file" part of the array is empty:
>>
>>   [Photo] => Array
>> (
>> [0] => Array
>> (
>> [file] =>
>> [user_id] => 1
>> )
>>
>> )
>>
>>  I tried a lot of different things but nothing worked the way I want.
>> What is the proper way to go about this?
>>
>>  - Ed
>>
>
>  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 cake-php@googlegroups.com
> 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?hl=en
>
>
>  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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
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?hl=en


Re: Getting .htpasswd protection to work

2010-05-12 Thread Andy Dirnberger
You need to use /the/full/path/to/app/.htpasswd.

On May 12, 11:17 pm, Jeff  wrote:
> Hi, I have the following in my /app/webroot/.htaccess file, as well as
> a matching .htpasswd file in the correct directory per multiple online
> how-to's, but my password protection is not working.  Can someone tell
> me what I am doing wrong?
>
> /app/webroot/.htaccess
>
> AuthUserFile /app/.htpasswd
> AuthName "Restricted Area"
> AuthType Basic
> require valid-user
>
> 
>
>         RewriteEngine On
>         RewriteCond %{REQUEST_FILENAME} !-d
>         RewriteCond %{REQUEST_FILENAME} !-f
>         RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
>
> 
>
> I saw one tutorial that said I needed to find httpd.conf or something
> to that effect, but I don't see anything.  Maybe this config file
> doesn't exist with the Cake setup
>
> Any help is GREATLY appreciated.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: Display Blob from db

2010-05-12 Thread Martin Radosta

An approach

in the controller:

function show_image($recordId) {
$this->set('data', $this->Model->findById($recordId));
$this->layout = 'ajax'
}


the view show_image.ctp:

Configure::write('debug', 0);
header("Content-type: image/jpeg"); //assume jpg image
echo $data['Model']['blob_file'];


your view:

echo $html->tag('img', array(
'src' => Router::url(array('controller' => 'your_controller', 
'action' => 'show_image', $userInfo['Photo'][0]['id']))

)
);


Regards

MARTIN



On 05/13/2010 12:26 AM, Ed Propsner wrote:
Besides the size there should be no diff between "binary" and "blob", 
I was just thinking that perhaps Cake handled them differently.
I played around with media view and it doesn't seem to be what I'm 
looking for.


I have it narrowed down to the headers and I can get the photo to 
display but it has to be in it's own view and even then I have to echo 
the image directly in the controller action ... this isn't working for 
me. I never usually store photos directly to the database but in this 
instance i feel it better serves my purpose without taking a hit on 
performance.


Ideally I would like to access the image through it's $hasMany assoc 
and nest it in an image tag but I'm at a loss for how to pull that off 
with Cake.




On Wed, May 12, 2010 at 3:12 PM, Ed Propsner > wrote:


I've been toying with this one for a while now and I'm not really
getting anywhere.

I'm trying to display a photo stored in db as type "blob". With
conventional PHP I would normally store the photo with type
"binary" and never had any issues ... Blob is not going so well.
I figure the problem has something to do with content type but MVC
is confusing me a bit when it comes to headers or media views. It
seems straightforward enough but I think I'm going about the wrong
way (I'm not using media view or headers at this point).

In my Users Model I set up a $hasMany assoc.

 var $hasMany = array(
'Photo' => array(
'className' => 'Photo',
'foreignKey'=> 'user_id',
'conditions'=> array('Photo.profile' => 1,
'Photo.private' => 0),
'limit'=> '1',
'dependent'=> true
)
);

Rendering the photo is the problem.

> View

$html->tag('img', array(
  'src' =>
$userInfo['Photo'][0]['file']
 )
)

the "file" part of the array is empty:

  [Photo] =>  Array
 (
 [0] =>  Array
 (
 [file] =>
 [user_id] =>  1
 )

 )

I tried a lot of different things but nothing worked the way I
want. What is the proper way to go about this?

- Ed


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 cake-php@googlegroups.com
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?hl=en


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 cake-php@googlegroups.com
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?hl=en


Re: Newbie Question about Upgrading

2010-05-12 Thread Jeremy Burns
This is perhaps not a direct answer to your question, but another suggestion. 
It is possible that some of the finds in your site's code are not built well. 
I'd encourage you debug out the results of the slow queries and see how much 
data is being returned. It could be that your query is requesting too much 
unnecessary data that is causing the load problems, not the performance of 
MySQL.

Jeremy Burns
jeremybu...@me.com


On 12 May 2010, at 19:35, Ephs wrote:

> Hello,
> 
> About two years ago I had someone make a website for me, and he used
> CakePHP. Now, I'm slowly learning how cakephp works in order to make
> updates (I know PHP fairly well). I'm having some mysql problems
> server load problems, and believe that upgrading to the newest version
> might help solve the issue (such as using mysql_free_result() on every
> query, not just the last one).
> 
> The version in version.txt currently shows 1.1.19.6305, so it seems I
> have a fairly old version. How would I go about updating to a newer
> version? What do I need to know before I begin? What version can I
> upgrade to? I just don't want the functionality of the website to mess
> up.
> 
> Any help is appreciated.
> 
> Thanks a lot.
> 
> 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 cake-php@googlegroups.com
> 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?hl=en

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 cake-php@googlegroups.com
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?hl=en


Authorizing problems with Auth compoment.

2010-05-12 Thread still
The problem confucing me is that when i using Auth, every action that
i not allowed in the

Auth->allow()
will be access denied even after i loged in with a correct username
and password.
Am i missunderstanding the usage of Auth component?  only the allowed
actions can be accessed?

/* app/app_controller */
var $components = array('Auth');

function beforeFilter()
{

$this->Auth->fields = array('username' => 'email', 'password' =>
'password');

$this->Auth->loginAction = array('controller' => 'users', 
'action'
=> 'login');

$this->Auth->loginRedirect = array('controller' => 'users', 
'action'
=> 'home');

$this->Auth->logoutRedirect = '/';

$this->Auth->loginError = 'Invalid e-mail / password 
combination.
Please try again';

$this->Auth->authorize = 'controller';



}

/*==im a seperator ==*/

/*users controller*/
var $name = 'Users';
var $components = array('Session');

function beforeFilter(){
$this->Auth->allow('login','logout','signup');
parent::beforeFilter();
}

function login()
{
// its blank.

}
function home()
{
 // do somthing homepage.
}




with these codes, when i sign in with a correct account, it will
successfully sign in then redirected to users/home action, but because
'home' action is not in the allow list , it's again redirected to the
loginAction with a flash message of 'You are not authorized to access
that location'(other not allowed actions for the same). But if i put
home action in the $this->Auth->allow(), it will be displayed well
with the correct user informations

By my understanding of Auth component, it should be displaying home
action cause ive already logged in. Am i wrong or doing something in a
wrong way ?

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 cake-php@googlegroups.com
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?hl=en


Re: Display Blob from db

2010-05-12 Thread Ed Propsner
Besides the size there should be no diff between "binary" and "blob", I was
just thinking that perhaps Cake handled them differently.
I played around with media view and it doesn't seem to be what I'm looking
for.

I have it narrowed down to the headers and I can get the photo to display
but it has to be in it's own view and even then I have to echo the image
directly in the controller action ... this isn't working for me. I never
usually store photos directly to the database but in this instance i feel it
better serves my purpose without taking a hit on performance.

Ideally I would like to access the image through it's $hasMany assoc and
nest it in an image tag but I'm at a loss for how to pull that off with
Cake.



On Wed, May 12, 2010 at 3:12 PM, Ed Propsner  wrote:

> I've been toying with this one for a while now and I'm not really getting
> anywhere.
>
> I'm trying to display a photo stored in db as type "blob". With
> conventional PHP I would normally store the photo with type "binary" and
> never had any issues ... Blob is not going so well.
> I figure the problem has something to do with content type but MVC is
> confusing me a bit when it comes to headers or media views. It seems
> straightforward enough but I think I'm going about the wrong way (I'm not
> using media view or headers at this point).
>
> In my Users Model I set up a $hasMany assoc.
>
>  var $hasMany = array(
> 'Photo' => array(
> 'className' => 'Photo',
> 'foreignKey'=> 'user_id',
> 'conditions'=> array('Photo.profile' => 1, 'Photo.private'
> => 0),
> 'limit'=> '1',
> 'dependent'=> true
> )
> );
>
> Rendering the photo is the problem.
>
> > View
>
> $html->tag('img', array(
>   'src' => $userInfo['Photo'][0]['file']
>  )
> )
>
> the "file" part of the array is empty:
>
>  [Photo] => Array
> (
> [0] => Array
> (
> [file] =>
> [user_id] => 1
> )
>
> )
>
> I tried a lot of different things but nothing worked the way I want. What
> is the proper way to go about this?
>
> - Ed
>

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 cake-php@googlegroups.com
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?hl=en


Getting .htpasswd protection to work

2010-05-12 Thread Jeff
Hi, I have the following in my /app/webroot/.htaccess file, as well as
a matching .htpasswd file in the correct directory per multiple online
how-to's, but my password protection is not working.  Can someone tell
me what I am doing wrong?

/app/webroot/.htaccess

AuthUserFile /app/.htpasswd
AuthName "Restricted Area"
AuthType Basic
require valid-user



RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]



I saw one tutorial that said I needed to find httpd.conf or something
to that effect, but I don't see anything.  Maybe this config file
doesn't exist with the Cake setup

Any help is GREATLY appreciated.

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 cake-php@googlegroups.com
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?hl=en


Dealing with forms!!!!!

2010-05-12 Thread sherzo

Hi all
I have a registration form which is loaded inside a div and included in the
page. I want to have some server-side validation on it and return the result
inside the specific div   any idea please? its really urgent! 

[Code]

flash(); ?>

create('User', array('action' => 'register','type' =>
'post','class'=>'account'));?>
Adı:
  text('first_name' , array ('length'=>20));?>

Soy Adı:
 text('last_name', array ('length'=>20));?>


Username:
  text('username', array('after' =>
$form->error('username_unique', 'The username is taken. Please try
again.')));?>


Şifre
  password('password');?>
  Hatalı şifre girişi

Tekrar Şifre
  password('confirm_password');
?>
  Hatalı şifre girişi



E-posta adresi:
  text('email', array('after' =>
$form->error('email_duplicate', 'This email address had been registered
before. Please try again.')));?>
  E-posta adresi kullanımda



  
   javascript:dropSozlesme() Kullanım Şartları 'nı kabul ediyorum.
  
MARKAPON KULLANICI SÖZLEŞMESİ
Kullanım Şartları'nı kabul ediyorum. Kullanım Şartları'nı kabul
ediyorum. Kullanım Şartları'nı kabul ediyorum. Kullanım Şartları'nı kabul
ediyorum. Kullanım Şartları'nı kabul ediyorum. Kullanım Şartları'nı kabul
ediyorum. Kullanım Şartları'nı kabul 
  
   # Yazdır 


submit('hesap-olustur-button.gif',
array('class'=>'submit'));?> 

end(); ?> 
 [/Code]


[Code]
if (!empty($this->data)) 
{  
$san = new Sanitize();
$this->data['User']['username'] =
$san->paranoid($this->data['User']['username']);
   if ($this->data['User']['password']!=
$this->data['User']['confirm_password'])
   {
$this->data['User']['password'] = '';
$this->data['User']['password_confirm'] = '';
$this->Session->setFlash(__('Password and 
Password
confirmation should be the same.', true));
$this->redirect($this->referer(), null, true);
exit();
   }
   else
   {
   $this->User->set($this->data); 
   $this->User->create();
   $this->User->data = Sanitize::clean($this->data);
   $this->data['User']['password'] =
md5($this->data['User']['password']); 
   $this->User->set('join_date', date('Y-m-d H:i:s'));
   $this->User->set('first_name',
$this->data['User']['first_name']);
   $this->User->set('username',
$this->data['User']['username']);
   $this->User->set('password',
$this->data['User']['password']);
   $this->User->set('email', $this->data['User']['email']);
   $this->User->set('status', 1);
   $this->User->set('referred', $this->Session->read('ref'));
 // Successfully created account - send activation email   
 //debug($this->data);   
 $result = $this->User->save($this->data);   
//if(!$this->User->save()){
   // debug($this->User->validationErrors); die();
//}
// debug($result);
   if ($result)  
   {
// this view is not show / listed - use your
imagination and inform
// users that an activation email has been
sent out to them.
   //$this->User->username =
$this->data['User']['username'];
 
 
//$this->__sendActivationEmail($this->User->getLastInsertID());
 if ($this->Session->read('ref'))
 {
$invited_id = 
$this->getUserId($this->data['User']['username']); 

$this->requestAction('/bonuses/updateStatus/'.$this->Session->read('ref').'/'.
$this->data['User']['email'].'/'. $invited_id);
 }
 $this->Session->setFlash('An invitation 
email just been
sent.',false);
 $this->redirect('/users/login');
   }

// Failed, clear password field
else {
$this->data['User']['password'] = '';
$this->data['User']['password_confirm'] = '';
$this->Session->setFlash(__('Some problem 
happened during
saving your information.', true));
}
}
}
 
}



[/Code]
-- 
View this message in context: 
http://old.nabble.com/Dealing-with-forms%21%21%21%21%21-tp28541795p28541795.html
Sent from the CakePHP mailing list archive at Nabble.com.

Check out

Containable Aggregate Fields Problem

2010-05-12 Thread emptywalls
I've got a Songs model, and each song HasMany Rating.

I want to query for a list of songs, and get the average Rating.

$this->Song->find('all', array(
'fields' => 'Song.title',
'contain' => array(Rating => array(
'fields' => array(AVG(Rating.value) as rating_average)
)
)

This works for the first record returned, but subsequent records have
an empty array where the rating average should be. What's going on? Am
I doing something wrong? I get the same result no matter if its SUM,
AVG, etc...

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 cake-php@googlegroups.com
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?hl=en


Newbie Question about Upgrading

2010-05-12 Thread Ephs
Hello,

About two years ago I had someone make a website for me, and he used
CakePHP. Now, I'm slowly learning how cakephp works in order to make
updates (I know PHP fairly well). I'm having some mysql problems
server load problems, and believe that upgrading to the newest version
might help solve the issue (such as using mysql_free_result() on every
query, not just the last one).

The version in version.txt currently shows 1.1.19.6305, so it seems I
have a fairly old version. How would I go about updating to a newer
version? What do I need to know before I begin? What version can I
upgrade to? I just don't want the functionality of the website to mess
up.

Any help is appreciated.

Thanks a lot.

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 cake-php@googlegroups.com
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?hl=en


Re: Automatically select a subset of a model's fields

2010-05-12 Thread
Hi,

In your associations you can name the fields that Cake retrieves in
the model associations - something like:

var $belongsTo = array(
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'fields' => array(
'User.id', 'User.email', 'etc', 'etc'),
)
);

Is the basic structure that will do the trick for you.

John

On May 12, 1:11 pm, Michele Ferri  wrote:
> Hi.
>
> In my web app I am bridging with PHPBB for user authentication, so my
> main user database table is PHPBB's user table. I created a Cake model
> for it.
> The problem is, lots of tables in my app join with the user table,
> which has a lot of fields related to PHPBB stuff, but I only really
> need the user id, name and email. Cake fetches all the fields
> everytime.
> Is there a way to specify a subset of fields to select, without having
> to add everytime a 'fields' option in the queries? I tried with the
> $_schema property but to no avail.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Gifts!

2010-05-12 Thread Mohamed Sathik
Dear friend,
How are you recently? tell you a big surprise!
Ktpshop company is  electronic products trading company which has
upper Asia ranked---(www.ktpshop.info) and it has cooperation with
Nokia, SONY, HP, etc for many years,the product quality is very good.
They have a good reputation , many good feedback,and the fast delivery speed.
Now, the company(ktpshop.com) enlarges its extent .Thanks for  the new
and old customers ' supporting , These goods are sold at a discount.,
a lot of friends have already bought the products from the company  ,
and they are  praised the goods,
I have ordered a apple laptops,
I hope you don't miss it.
greetings!

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 cake-php@googlegroups.com
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?hl=en


Display Blob from db

2010-05-12 Thread Ed Propsner
I've been toying with this one for a while now and I'm not really getting
anywhere.

I'm trying to display a photo stored in db as type "blob". With conventional
PHP I would normally store the photo with type "binary" and never had any
issues ... Blob is not going so well.
I figure the problem has something to do with content type but MVC is
confusing me a bit when it comes to headers or media views. It seems
straightforward enough but I think I'm going about the wrong way (I'm not
using media view or headers at this point).

In my Users Model I set up a $hasMany assoc.

 var $hasMany = array(
'Photo' => array(
'className' => 'Photo',
'foreignKey'=> 'user_id',
'conditions'=> array('Photo.profile' => 1, 'Photo.private'
=> 0),
'limit'=> '1',
'dependent'=> true
)
);

Rendering the photo is the problem.

> View

$html->tag('img', array(
  'src' => $userInfo['Photo'][0]['file']
 )
)

the "file" part of the array is empty:

 [Photo] => Array
(
[0] => Array
(
[file] =>
[user_id] => 1
)

)

I tried a lot of different things but nothing worked the way I want. What is
the proper way to go about this?

- Ed

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 cake-php@googlegroups.com
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?hl=en


Re: Issue with find('list')

2010-05-12 Thread Robert McWay
First thing you might want to do is take the set function call out of
the if(empty()) conditional you have. The reason is because you want
this variable set every time, regardless of the state of $this->data,
to keep the select options properly populated. The way you have it
now, you will lose your select options in the event that you have to
resubmit the form due to errors, etc, because then the $this->data
array is set.

Second, you can force the input field to become a select by using the
select() function. Try switching your input function with that.

$form->select('finished_product_id', $finished_products, null,
array());

or

$form->input('finished_product_id', array('options' =>
$finished_products));

Hope that helps.

On May 11, 2:25 pm, Stefano Martins  wrote:
> Hey folks,
>
> I have two controllers: ConfigurationsController and
> FinishedProductsController. Here's the code for the
> ConfigurationsController:
>
>          class ConfigurationsController extends AppController
>         {
>                 public function add()
>                 {
>                         if(empty($this->data))
>                         {
>                                 $this->set('finished_products', 
> $this->Configuration->FinishedProduct->find('list'));
>
>                         }
>                 }
>         }
> ?>
>
> In the view, the select is showing up right, but its not populated
> with the finished products. Here's the code for the view:
>
>          echo $form->create('Configuration');
>         echo $form->input('finished_product_id');
>         echo $form->input('ammount_of_items');
>         echo $form->end('Próximo passo');
> ?>
>
> Can someone help me out?
>
> Thanks!
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: i18n / l10n Problem with Cake 1.3

2010-05-12 Thread Miles J
If you want German, its "deu" and not "ger". I ran into this problem
also.

On May 12, 8:53 am, John Andersen  wrote:
> Check that your directory names and file names are in the expected
> case (upper/lower)!
> Ensure that CakePHP have read access to the directories!
> Hope this helps you,
>    John
>
> On May 12, 5:35 pm, nils  wrote:
>
>
>
> > Hi all,
>
> > ok, I got:
>
> > - "Configure::write('Config.language', 'ger');" in bootstrap (tried
> > core, too!)
> > - "C:\stuff\xampp\htdocs\caketest\app\locale\ger\LC_MESSAGES
> > \default.po" in place (pot created with cake i18n, renamed to .po)
> > - "" in my ctp
>
> > ..and it still doesn't work!
>
> > Drives me insane, I must be missing some ultra-important thing here,
> > though there aren't even any error messages!
>
> > Help, pretty please! :)
>
> > nils
>
> > ps: and it won't use my english .po either.. :/
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: Multiple AJAX Forms on same page all submitting to first form.

2010-05-12 Thread John Andersen
As Nilz wrote, you have two keys with the name of "id" in your array!
That can't work!
So check you form create statement and correct it!
Enjoy,
   John

On May 12, 7:17 pm, Robert McWay 
wrote:
> I took another look at the generated HTML, like you suggested Matt,
> and found something very strange. The multiple forms i have on this
> page are being generated by a loop. It appears that the first form
> generates the proper opening and closing form tags, along with the
> javascript for the AJAX. But then looking at the 2nd and 3rd forms in
> the code, i realized that the opening form tag is not being inserted,
> as well as the closing form tag, The submit button and proper
> javascript are still being generated, but for some reason the form
> tags just don't generate past the first form. Any idea why?
>
[snip]

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 cake-php@googlegroups.com
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?hl=en


Re: CakePhp Shell Issue

2010-05-12 Thread aboxy
Figured it out.

Here was the issue My shell script was under /myapp/vendor/shells
which was wrong. It should have been under /myapp/app/vendor/shells.
After I moved the file, it worked. Hope this helps someone.
thanks

On May 11, 6:27 pm, aboxy  wrote:
> Hello,
>
> I am just getting started with Cakephp shell and running into issues.
> My cake core library is under path d:/libs/cake My app is setup under
> d:/servers/htdocs/myapp
>
> I wrote a test shell under d:/servers/htdocs/myapp/vendor/shells
>
> class ReportShell extends Shell { var $uses = array('Appt'); function
> main() { echo $this->Appt->find('first');
>
> } }
>
> When I try to run this code from d:/servers/htdocs/myapp , It gives me
> an error
>
> Warning: include_once(d:/servers/htdocs/myapp/config/database.php):
> failed to open stream: No such file or directory in d:/libs/cake\libs
> \mode l\connection_manager.php on line 23
>
> Warning: include_once(): Failed opening 'd:/servers/htdocs/myapp/
> config/database.php' for inclusion (include_path='.;D:\work\xampp\php
> \PEAR') in d:/libs/cake\libs\model\connection_manager.php on line 23
>
> Fatal error: ConnectionManager::getDataSource - Non-existent data
> source default in d:/libs/cake\libs\model\connection_manager.php on
> line 102
>
> Reason is that it is trying to find database.php under 'd:/servers/
> htdocs/myapp/config/' and the correct path is 'd:/servers/htdocs/myapp/
> app/config/database.php'
>
> What am I doing wrong here?
>
> thanks
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: Multiple AJAX Forms on same page all submitting to first form.

2010-05-12 Thread Robert McWay
I took another look at the generated HTML, like you suggested Matt,
and found something very strange. The multiple forms i have on this
page are being generated by a loop. It appears that the first form
generates the proper opening and closing form tags, along with the
javascript for the AJAX. But then looking at the 2nd and 3rd forms in
the code, i realized that the opening form tag is not being inserted,
as well as the closing form tag, The submit button and proper
javascript are still being generated, but for some reason the form
tags just don't generate past the first form. Any idea why?

On May 7, 8:19 am, Matthew Powell  wrote:
> Take a look at the generated HTML.  It sounds very much like the first
> form isn't being terminated properly (no  tag).  This causes
> the fields in the second form to think they are part of the first
> form.
>
>
>
>
>
> On Thu, May 6, 2010 at 22:45, Nilz  wrote:
>
> > Why are you using two ids?
>
> > create('User', array('action'=>'check', 'id'=>
> > $formid, 'name'=>$formid, 'id' => $submitid)); ?>
>
> > I use $ajax->form to work this fine for me.
>
> > Hope it help.
>
> > On May 7, 2:10 am, Robert McWay 
> > wrote:
> >> Hello All,
>
> >> I am having trouble with puttingmultipleajaxform instances on the
> >> same page. All the forms have the same fields, with the exception of a
> >> hidden field passing the User Id. Upon submitting the form, it always
> >> submits the form fields in the first form, regardless of which form i
> >> submit. I have given  the each submit, and form unique ids, but it
> >> still seems to always submit that first form. Here is an example of a
> >> couple forms:
>
> >>  >> $update = 'availability'.$t['id'];
> >> $formid = 'a'.$t['id'];
> >> $submitid = 'submit'.$t['id'];
> >> ?>
> >> create('User', array('action'=>'check', 'id'=>
> >> $formid, 'name'=>$formid, 'id' => $submitid)); ?>
> >> hidden('tutor_id.'.$t['id'], array('value'=>
> >> $t['id']))?>
> >> ...more identical form checkbox fields
>
> >> submit('Check', array('url'=>
> >> array('controller'=>'users', 'action'=>'check'), 'update' => $update,
> >> 'id' => $submitid)); ?>
>
> >> Any ideas?
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: i18n / l10n Problem with Cake 1.3

2010-05-12 Thread John Andersen
Check that your directory names and file names are in the expected
case (upper/lower)!
Ensure that CakePHP have read access to the directories!
Hope this helps you,
   John

On May 12, 5:35 pm, nils  wrote:
> Hi all,
>
> ok, I got:
>
> - "Configure::write('Config.language', 'ger');" in bootstrap (tried
> core, too!)
> - "C:\stuff\xampp\htdocs\caketest\app\locale\ger\LC_MESSAGES
> \default.po" in place (pot created with cake i18n, renamed to .po)
> - "" in my ctp
>
> ..and it still doesn't work!
>
> Drives me insane, I must be missing some ultra-important thing here,
> though there aren't even any error messages!
>
> Help, pretty please! :)
>
> nils
>
> ps: and it won't use my english .po either.. :/
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


i18n / l10n Problem with Cake 1.3

2010-05-12 Thread nils
Hi all,

ok, I got:

- "Configure::write('Config.language', 'ger');" in bootstrap (tried
core, too!)
- "C:\stuff\xampp\htdocs\caketest\app\locale\ger\LC_MESSAGES
\default.po" in place (pot created with cake i18n, renamed to .po)
- "" in my ctp

..and it still doesn't work!

Drives me insane, I must be missing some ultra-important thing here,
though there aren't even any error messages!

Help, pretty please! :)

nils

ps: and it won't use my english .po either.. :/

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 cake-php@googlegroups.com
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?hl=en


Re: when i am trying to insert a data in to database the following error shows please help me out

2010-05-12 Thread John Andersen
As the error message states, you have an error in the database, not in
the CakePHP application.
Go through the database and establish the missing part.
Enjoy,
   John

On May 12, 3:44 pm, Narendra Padala  wrote:
> Hi..!,
> I am new to cake php,usuing PostgreSql,When i am inserting a record
> its shows the follwoing error any one please help me out.
>
> Error:
> -
> Warning (2):pg_query() [function.pg-query]: Query failed: ERROR:
> relation "tblcdlog_id_seq" does not exist [CORE/cake/libs/model/
> datasources/dbo/dbo_postgres.php, line 155]
>
> Warning (512):SQL Error: ERROR:  relation "tblcdlog_id_seq" does not
> exist [CORE/cake/libs/model/datasources/dbo_source.php, line 526
>
> Query: SELECT currval('tblcdlog_id_seq') as max
>
> ---
> My database table structure like this
> Sequence "public.tblcdlog_lngcdlog_seq"
>    Column     |  Type
> ---+-
>  sequence_name | name
>  last_value           | bigint
> increment_by  | bigint
>  max_value     | bigint
>  min_value     | bigint
>  cache_value   | bigint
>  log_cnt       | bigint
>  is_cycled     | boolean
>  is_called     | boolean
>
> Table : tblcdlog
> 
>                                            Table "public.tblcdlog"
>      Column              |            Type
> |                          Modifiers
> -+-
> +-
>  lngcdlog                 | integer                        | not null
> default nextval('tblcdlog_lngcdlog_seq'::regclass)
>  dtmcreated            | timestamp without time zone | not null
>  strcdno                  | character varying(50)       |
>  strversion               | character varying(50)       |
>  lngcdlog_type         | integer                           | not null
>  blnsuccess             | bit(1)                              | not
> null
>  strerrordesc            | character varying(255)      |
>  strupdateno             | character varying(10)       |
>  blnlogged_to_rr |      boolean                          | not null
> default false
> Indexes:
>     "tblcdlog_pkey" PRIMARY KEY, btree (lngcdlog)
> Foreign-key constraints:
>     "tblcdlog_lngcdlog_type_fkey" FOREIGN KEY (lngcdlog_type)
> REFERENCES tlkcdlog_type(lngcdlog_type)
>
> I was worte code like this...!
>
>                $strDate = date("Y-m-d H:i:s");
>                echo $this->data['Tblcdlog']['dtmcreated']= $strDate;
>                echo $this->data['Tblcdlog']['strcdno']= "C520080205";
>                echo $this->data['Tblcdlog']['lngcdlog_type'] = 1;
>                echo $this->data['Tblcdlog']['blnsuccess'] = 0;
>                $this->Tblcdlog->create();
>                if ($this->Tblcdlog->save($this->data)) {
>                     $this->Session->setFlash('The clockin has been
> saved');
>                }
>
> I have to insert data  this much only after some time i will update
> the remaing fileds please help me outthanks in advance
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: sql error 1054 unknown column in 'on clause'

2010-05-12 Thread John Andersen
I'll rephrase my question, can you show me the SQL description of the
store_types table, like this:
[code]
CREATE TABLE `store_types` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(40) NOT NULL,
PRIMARY KEY (`id`)
)
[/code]

I ask because I want to be sure that the table has a primary key named
"store_type_id"!

Another option is to try to leave out the fields parameter and see
what you then get!
Enjoy,
   John

On May 12, 7:38 am, Ambika Kulkarni 
wrote:
> In store_types tbl primary key is store_type_id
>
[snip]

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 cake-php@googlegroups.com
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?hl=en


AjaxHelper::editor + ckeditor

2010-05-12 Thread mrnnn
Hi all.

Well, I think the title says it all. If I could just call a javascript
method after the div has been converted to a textarea, that would be
enough! but i can't find any option that does this.

could anybody give me some pointers on how to allow in-place editing
with ckeditor or any wysiwyg editor.


Thank you so much.

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 cake-php@googlegroups.com
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?hl=en


Re: How i Give Css on link

2010-05-12 Thread Jeremy Burns
Spooky...

Jeremy Burns
jeremybu...@me.com


On 12 May 2010, at 14:24, Sam Sherlock wrote:

> do you mean give a link a class or id attribute?
> 
> pass your attribs to the options param of HtmlHelper link
> 
> echo $html->link('Search',array('action'=>'search'), array('class' => 
> 'supaSearch', 'id' => 'supaSearch'));
> 
> also if your accessing an action of the current controller you dont need to 
> pass $this->params['controller'] 
> 
> - S
> 
> 
> 
> On 12 May 2010 12:11, Dilip Godhani  wrote:
> how i appply css on link  tag
> in cakephp
> 
>  $html->link('Search',array('controller'=>$this->params['controller'],'action'=>'search'));
>  ?>
> Help me
> 
> Thanks
> 
> -- 
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
> 
> 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 cake-php@googlegroups.com
> 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?hl=en
> 
> 
> 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 cake-php@googlegroups.com
> 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?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: How i Give Css on link

2010-05-12 Thread Sam Sherlock
do you mean give a link a class or id attribute?

pass your attribs to the options param of HtmlHelper link

echo $html->link('Search',array('action'=>'search'), array('class' =>
'supaSearch', 'id' => 'supaSearch'));

also if your accessing an action of the current controller you dont need to
pass $this->params['controller']

- S



On 12 May 2010 12:11, Dilip Godhani  wrote:

> how i appply css on link  tag
> in cakephp
>
>  $html->link('Search',array('controller'=>$this->params['controller'],'action'=>'search'));
> ?>
> Help me
>
> Thanks
>
> --
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
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?hl=en


Re: How i Give Css on link

2010-05-12 Thread Jeremy Burns
This code will render a straightforward html link on your page, so if it is 
part of a div or other element, then the appropriate  CSS style will apply 
to it. If you want to specify the id, name or class of the link, then put it in 
the $htmlAttributes array:

Syntax: link(
string $title,
mixed $url = null,
array $htmlAttributes = array(),
string $confirmMessage = false
)

So your example would look something like this:

echo $html->link(
'Search',
array(
'controller' => $this->params['controller'],
'action'=>'search'
),
array(
'class' => 'my-class',
'id' => 'myId',
'name' => 'myName'
)
);

http://book.cakephp.org/view/1442/link

As an aside, you don't need to use $this->params['controller']. By default, 
Cake will use the current controller when building the link.

Jeremy Burns
jeremybu...@me.com


On 12 May 2010, at 12:11, Dilip Godhani wrote:

> how i appply css on link  tag
> in cakephp
> 
>  $html->link('Search',array('controller'=>$this->params['controller'],'action'=>'search'));
>  ?>
> Help me
> 
> Thanks
> 
> -- 
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
> 
> 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 cake-php@googlegroups.com
> 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?hl=en

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 cake-php@googlegroups.com
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?hl=en


How i Give Css on link

2010-05-12 Thread Dilip Godhani
how i appply css on link  tag
in cakephp

link('Search',array('controller'=>$this->params['controller'],'action'=>'search'));
?>
Help me

Thanks

-- 
Dilip Godhani
Jr Software Developer, Entourage Solutions
e-mail: di...@entouragesolutions.com
  dilip.godh...@gmail.com
Web.: www.entouragesolutions.com
m. 9913822582

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 cake-php@googlegroups.com
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?hl=en


when i am trying to insert a data in to database the following error shows please help me out

2010-05-12 Thread Narendra Padala
Hi..!,
I am new to cake php,usuing PostgreSql,When i am inserting a record
its shows the follwoing error any one please help me out.

Error:
-
Warning (2):pg_query() [function.pg-query]: Query failed: ERROR:
relation "tblcdlog_id_seq" does not exist [CORE/cake/libs/model/
datasources/dbo/dbo_postgres.php, line 155]

Warning (512):SQL Error: ERROR:  relation "tblcdlog_id_seq" does not
exist [CORE/cake/libs/model/datasources/dbo_source.php, line 526

Query: SELECT currval('tblcdlog_id_seq') as max


---
My database table structure like this
Sequence "public.tblcdlog_lngcdlog_seq"
   Column |  Type
---+-
 sequence_name | name
 last_value   | bigint
increment_by  | bigint
 max_value | bigint
 min_value | bigint
 cache_value   | bigint
 log_cnt   | bigint
 is_cycled | boolean
 is_called | boolean




Table : tblcdlog

   Table "public.tblcdlog"
 Column  |Type
|  Modifiers
-+-
+-
 lngcdlog | integer| not null
default nextval('tblcdlog_lngcdlog_seq'::regclass)
 dtmcreated| timestamp without time zone | not null
 strcdno  | character varying(50)   |
 strversion   | character varying(50)   |
 lngcdlog_type | integer   | not null
 blnsuccess | bit(1)  | not
null
 strerrordesc| character varying(255)  |
 strupdateno | character varying(10)   |
 blnlogged_to_rr |  boolean  | not null
default false
Indexes:
"tblcdlog_pkey" PRIMARY KEY, btree (lngcdlog)
Foreign-key constraints:
"tblcdlog_lngcdlog_type_fkey" FOREIGN KEY (lngcdlog_type)
REFERENCES tlkcdlog_type(lngcdlog_type)



I was worte code like this...!

   $strDate = date("Y-m-d H:i:s");
   echo $this->data['Tblcdlog']['dtmcreated']= $strDate;
   echo $this->data['Tblcdlog']['strcdno']= "C520080205";
   echo $this->data['Tblcdlog']['lngcdlog_type'] = 1;
   echo $this->data['Tblcdlog']['blnsuccess'] = 0;
   $this->Tblcdlog->create();
   if ($this->Tblcdlog->save($this->data)) {
$this->Session->setFlash('The clockin has been
saved');
   }

I have to insert data  this much only after some time i will update
the remaing fileds please help me outthanks in advance










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 cake-php@googlegroups.com
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?hl=en


Automatically select a subset of a model's fields

2010-05-12 Thread Michele Ferri
Hi.

In my web app I am bridging with PHPBB for user authentication, so my
main user database table is PHPBB's user table. I created a Cake model
for it.
The problem is, lots of tables in my app join with the user table,
which has a lot of fields related to PHPBB stuff, but I only really
need the user id, name and email. Cake fetches all the fields
everytime.
Is there a way to specify a subset of fields to select, without having
to add everytime a 'fields' option in the queries? I tried with the
$_schema property but to no avail.

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 cake-php@googlegroups.com
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?hl=en


Re: Cake caching model associations?

2010-05-12 Thread
Oops, forgot that I also moved them into separate Plugins - fixed the
problem now with a simple bit of common sense!

Cheers!

On May 12, 12:47 pm, "WoJo&Co"  wrote:
> Hi,
>
> Quick question about Cake and model associations.
>
> I had an association that worked fine:
>
> User hasOne UserAccount
> fk: UserAccount.user_id
>
> UserAccount belongsTo Club
> fk: UserAccount.club_id
>
> I have now changed this, so that
>
> User hasOne UserAccount
> fk: UserAccount.user_id
>
> UserAccount belongsTo ClubAccount
> fk: UserAccount.club_account_id
>
> Despite having been through every model, deleted the cache and set
> debug to 2, Cake is still trying to join UserAccount with Club rather
> than ClubAccount. I'm at my wits end trying to work out where this is
> going wrong, even to the point of deleting and rewriting all of the
> model files, but it still is looking for the old association.
>
> There are no relationships set up in the database (MyISAM rather than
> InnoDB so that can't be the problem) and the database fields are
> correct for the new arrangement.
>
> Anybody got any ideas?
>
> Cheers!
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Cake caching model associations?

2010-05-12 Thread
Hi,

Quick question about Cake and model associations.

I had an association that worked fine:

User hasOne UserAccount
fk: UserAccount.user_id

UserAccount belongsTo Club
fk: UserAccount.club_id


I have now changed this, so that

User hasOne UserAccount
fk: UserAccount.user_id

UserAccount belongsTo ClubAccount
fk: UserAccount.club_account_id


Despite having been through every model, deleted the cache and set
debug to 2, Cake is still trying to join UserAccount with Club rather
than ClubAccount. I'm at my wits end trying to work out where this is
going wrong, even to the point of deleting and rewriting all of the
model files, but it still is looking for the old association.

There are no relationships set up in the database (MyISAM rather than
InnoDB so that can't be the problem) and the database fields are
correct for the new arrangement.

Anybody got any ideas?

Cheers!

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 cake-php@googlegroups.com
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?hl=en


Re: edit the table data.

2010-05-12 Thread Jeremy Burns
Pleased to help. Master Ram - I have seen several posts from you and the answer 
almost always lies in compliance with standards. If you are new to Cake, why 
are you not sticking to what works? You are swimming against the tide.

Jeremy Burns
jeremybu...@me.com


On 12 May 2010, at 10:50, Master Ram wrote:

> thank u sir its working... now
> 
> On May 12, 2:43 pm, Jeremy Burns  wrote:
>> Your mistake probably lies in your model. You have deviated away from Cake 
>> standards by naming your primary key 'promoter_id'. That's a bad move - 
>> change it if you can, otherwise accept a career full of unnecessary 
>> challenges (and some unsympathetic answers to your self inflicted woes).
>> 
>> You haven't said so, but I presume the table is called 'promoters'? If so, 
>> make sure you have this line in your Promoter model:
>> 
>> var $primaryKey = 'promoter_id';
>> 
>> In terms of sample code - have you even looked at the guide?
>> 
>> Jeremy Burns
>> jeremybu...@me.com
>> 
>> On 12 May 2010, at 10:27, Master Ram wrote:
>> 
>> 
>> 
>>> HI.. All i ma new for cakephp
>> 
>>> my table fields are: promoter_id, agency_id, name, surname, ect..
>> 
>>> i am fetching the existing data form the table. i am not able to edit
>>> the data.
>> 
>>> this edit code: in the controller:
>> 
>>> function edit($promoter_id=null) {
>>>  if (!$promoter_id && empty($this->data)) {
>>> $this->Session->setFlash('Invalid Book', true);
>>> $this->redirect(array('action'=>'promoter'));
>>>  }
>>>  if (empty($this->data)) {
>>> $this->data = $this->Promoter->read(null, $promoter_id);
>>>  }
>>>  else {
>>> $this->Promoter->create();
>>> if(!!$this->Promoter->save($this->data)) {
>>>$this->Session->setFlash('Book is Updated!', true);
>>>$this->redirect(array('action'=>'promoters_step_two'),
>>> null, true);
>>> }
>>>  }
>>>   }
>> 
>>> this is my view code:
>>> $promoter_id=array();
>>> $agency_id=array();
>>> $name=array();
>>> $surname=array();
>> 
>>> $x=0;
>>> foreach( $clockOutChecks as
>>> $clockOutCheck ) {
>>>  echo  $promoter_id[$x]=
>>> $clockOutCheck['Promoter']['promoter_id'];
>>>  echo  $agency_id[$x]=
>>> $clockOutCheck['Promoter']['agency_id'];
>>>  echo  $name[$x]=
>>> $clockOutCheck['Promoter']['name'];
>>>  echo  $surname[$x]=
>>> $clockOutCheck['Promoter']['surname'];
>> 
>>> e($form->create('Promoter', array('action' => 'promoters_step_two',
>>> $promoter_id)));
>> 
>>> e($form-
 text('promoter_id',array('value'=>$promoter_id[0])));
>>> e($form-
 text('agency_id',array('value'=>$agency_id[0])));
>>> e($form->text('name',array('value'=>
>>> $name[0])));
>>> e($form-
 text('surname',array('value'=>$surname[0])));
>> 
>>> these are the new fields i want to add form same promoter_id.
>> 
>>> e($form->text('top_size'));
>>>e($form->text('pants_size'));
>>>e($form->text('bra_size'));
>>>e($form->text('shoe_size'));
>>>e($form->text('hair_colour'));
>>>e($form->text('eye_colour'));
>> 
>>>e($form->submit('next >'));
>>>e($form->end());
>> 
>>> where i did the mistake..
>>> please help me..
>> 
>>> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php?hl=en
>> 
>> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> athttp://groups.google.com/group/cake-php?hl=en
> 
> 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 cake-php@googlegroups.com
> To unsubscrib

Re: edit the table data.

2010-05-12 Thread Master Ram
thank u sir its working... now

On May 12, 2:43 pm, Jeremy Burns  wrote:
> Your mistake probably lies in your model. You have deviated away from Cake 
> standards by naming your primary key 'promoter_id'. That's a bad move - 
> change it if you can, otherwise accept a career full of unnecessary 
> challenges (and some unsympathetic answers to your self inflicted woes).
>
> You haven't said so, but I presume the table is called 'promoters'? If so, 
> make sure you have this line in your Promoter model:
>
> var $primaryKey = 'promoter_id';
>
> In terms of sample code - have you even looked at the guide?
>
> Jeremy Burns
> jeremybu...@me.com
>
> On 12 May 2010, at 10:27, Master Ram wrote:
>
>
>
> > HI.. All i ma new for cakephp
>
> > my table fields are: promoter_id, agency_id, name, surname, ect..
>
> > i am fetching the existing data form the table. i am not able to edit
> > the data.
>
> > this edit code: in the controller:
>
> > function edit($promoter_id=null) {
> >      if (!$promoter_id && empty($this->data)) {
> >         $this->Session->setFlash('Invalid Book', true);
> >         $this->redirect(array('action'=>'promoter'));
> >      }
> >      if (empty($this->data)) {
> >         $this->data = $this->Promoter->read(null, $promoter_id);
> >      }
> >      else {
> >         $this->Promoter->create();
> >         if(!!$this->Promoter->save($this->data)) {
> >            $this->Session->setFlash('Book is Updated!', true);
> >            $this->redirect(array('action'=>'promoters_step_two'),
> > null, true);
> >         }
> >      }
> >   }
>
> > this is my view code:
> > $promoter_id=array();
> >                                 $agency_id=array();
> >                                 $name=array();
> >                                 $surname=array();
>
> > $x=0;
> >                                 foreach( $clockOutChecks as
> > $clockOutCheck ) {
> >                                      echo  $promoter_id[$x]=
> > $clockOutCheck['Promoter']['promoter_id'];
> >                                      echo  $agency_id[$x]=
> > $clockOutCheck['Promoter']['agency_id'];
> >                                      echo  $name[$x]=
> > $clockOutCheck['Promoter']['name'];
> >                                      echo  $surname[$x]=
> > $clockOutCheck['Promoter']['surname'];
>
> > e($form->create('Promoter', array('action' => 'promoters_step_two',
> > $promoter_id)));
>
> >                                 e($form-
> >> text('promoter_id',array('value'=>$promoter_id[0])));
> >                                 e($form-
> >> text('agency_id',array('value'=>$agency_id[0])));
> >                                 e($form->text('name',array('value'=>
> > $name[0])));
> >                                 e($form-
> >> text('surname',array('value'=>$surname[0])));
>
> > these are the new fields i want to add form same promoter_id.
>
> > e($form->text('top_size'));
> >                                e($form->text('pants_size'));
> >                                e($form->text('bra_size'));
> >                                e($form->text('shoe_size'));
> >                                e($form->text('hair_colour'));
> >                                e($form->text('eye_colour'));
>
> >                                e($form->submit('next >'));
> >                                e($form->end());
>
> > where i did the mistake..
> > please help me..
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: edit the table data.

2010-05-12 Thread Jeremy Burns
Your mistake probably lies in your model. You have deviated away from Cake 
standards by naming your primary key 'promoter_id'. That's a bad move - change 
it if you can, otherwise accept a career full of unnecessary challenges (and 
some unsympathetic answers to your self inflicted woes).

You haven't said so, but I presume the table is called 'promoters'? If so, make 
sure you have this line in your Promoter model:

var $primaryKey = 'promoter_id';

In terms of sample code - have you even looked at the guide?

Jeremy Burns
jeremybu...@me.com


On 12 May 2010, at 10:27, Master Ram wrote:

> HI.. All i ma new for cakephp
> 
> my table fields are: promoter_id, agency_id, name, surname, ect..
> 
> i am fetching the existing data form the table. i am not able to edit
> the data.
> 
> this edit code: in the controller:
> 
> function edit($promoter_id=null) {
>  if (!$promoter_id && empty($this->data)) {
> $this->Session->setFlash('Invalid Book', true);
> $this->redirect(array('action'=>'promoter'));
>  }
>  if (empty($this->data)) {
> $this->data = $this->Promoter->read(null, $promoter_id);
>  }
>  else {
> $this->Promoter->create();
> if(!!$this->Promoter->save($this->data)) {
>$this->Session->setFlash('Book is Updated!', true);
>$this->redirect(array('action'=>'promoters_step_two'),
> null, true);
> }
>  }
>   }
> 
> this is my view code:
> $promoter_id=array();
> $agency_id=array();
> $name=array();
> $surname=array();
> 
> 
> $x=0;
> foreach( $clockOutChecks as
> $clockOutCheck ) {
>  echo  $promoter_id[$x]=
> $clockOutCheck['Promoter']['promoter_id'];
>  echo  $agency_id[$x]=
> $clockOutCheck['Promoter']['agency_id'];
>  echo  $name[$x]=
> $clockOutCheck['Promoter']['name'];
>  echo  $surname[$x]=
> $clockOutCheck['Promoter']['surname'];
> 
> e($form->create('Promoter', array('action' => 'promoters_step_two',
> $promoter_id)));
> 
> e($form-
>> text('promoter_id',array('value'=>$promoter_id[0])));
> e($form-
>> text('agency_id',array('value'=>$agency_id[0])));
> e($form->text('name',array('value'=>
> $name[0])));
> e($form-
>> text('surname',array('value'=>$surname[0])));
> 
> 
> these are the new fields i want to add form same promoter_id.
> 
> e($form->text('top_size'));
>e($form->text('pants_size'));
>e($form->text('bra_size'));
>e($form->text('shoe_size'));
>e($form->text('hair_colour'));
>e($form->text('eye_colour'));
> 
>e($form->submit('next >'));
>e($form->end());
> 
> where i did the mistake..
> please help me..
> 
> 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 cake-php@googlegroups.com
> 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?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: edit the table data.

2010-05-12 Thread Master Ram
you have any sample code. for edit.

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 cake-php@googlegroups.com
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?hl=en


Re: edit the table data.

2010-05-12 Thread AD7six


On May 12, 11:27 am, Master Ram  wrote:
> HI.. All i ma new for cakephp
>
> my table fields are: promoter_id, agency_id, name, surname, ect..
>
> i am fetching the existing data form the table. i am not able to edit
> the data.
>
> this edit code: in the controller:
>
> function edit($promoter_id=null) {
>       if (!$promoter_id && empty($this->data)) {
>          $this->Session->setFlash('Invalid Book', true);
>          $this->redirect(array('action'=>'promoter'));
>       }
>       if (empty($this->data)) {
>          $this->data = $this->Promoter->read(null, $promoter_id);
>       }
>       else {
>          $this->Promoter->create();
>          if(!!$this->Promoter->save($this->data)) {
>             $this->Session->setFlash('Book is Updated!', true);
>             $this->redirect(array('action'=>'promoters_step_two'),
> null, true);
>          }
>       }
>    }
>
> this is my view code:
> $promoter_id=array();
>                                  $agency_id=array();
>                                  $name=array();
>                                  $surname=array();
>
> $x=0;
>                                  foreach( $clockOutChecks as
> $clockOutCheck ) {
>                                       echo  $promoter_id[$x]=
> $clockOutCheck['Promoter']['promoter_id'];
>                                       echo  $agency_id[$x]=
> $clockOutCheck['Promoter']['agency_id'];
>                                       echo  $name[$x]=
> $clockOutCheck['Promoter']['name'];
>                                       echo  $surname[$x]=
> $clockOutCheck['Promoter']['surname'];
>
> e($form->create('Promoter', array('action' => 'promoters_step_two',
> $promoter_id)));
>
>                                  
> e($form->text('promoter_id',array('value'=>$promoter_id[0])));
>
>                                  
> e($form->text('agency_id',array('value'=>$agency_id[0])));
>
>                                  e($form->text('name',array('value'=>
> $name[0])));
>                                  e($form-
>
> >text('surname',array('value'=>$surname[0])));
>
> these are the new fields i want to add form same promoter_id.
>
> e($form->text('top_size'));
>                                 e($form->text('pants_size'));
>                                 e($form->text('bra_size'));
>                                 e($form->text('shoe_size'));
>                                 e($form->text('hair_colour'));
>                                 e($form->text('eye_colour'));
>
>                                 e($form->submit('next >'));
>                                 e($form->end());
>
> where i did the mistake..

Is it  that the code in the wrong color?

http://catb.org/~esr/faqs/smart-questions.html#beprecise

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 cake-php@googlegroups.com
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?hl=en


edit the table data.

2010-05-12 Thread Master Ram
HI.. All i ma new for cakephp

my table fields are: promoter_id, agency_id, name, surname, ect..

i am fetching the existing data form the table. i am not able to edit
the data.

this edit code: in the controller:

function edit($promoter_id=null) {
  if (!$promoter_id && empty($this->data)) {
 $this->Session->setFlash('Invalid Book', true);
 $this->redirect(array('action'=>'promoter'));
  }
  if (empty($this->data)) {
 $this->data = $this->Promoter->read(null, $promoter_id);
  }
  else {
 $this->Promoter->create();
 if(!!$this->Promoter->save($this->data)) {
$this->Session->setFlash('Book is Updated!', true);
$this->redirect(array('action'=>'promoters_step_two'),
null, true);
 }
  }
   }

this is my view code:
$promoter_id=array();
 $agency_id=array();
 $name=array();
 $surname=array();


$x=0;
 foreach( $clockOutChecks as
$clockOutCheck ) {
  echo  $promoter_id[$x]=
$clockOutCheck['Promoter']['promoter_id'];
  echo  $agency_id[$x]=
$clockOutCheck['Promoter']['agency_id'];
  echo  $name[$x]=
$clockOutCheck['Promoter']['name'];
  echo  $surname[$x]=
$clockOutCheck['Promoter']['surname'];

e($form->create('Promoter', array('action' => 'promoters_step_two',
$promoter_id)));

 e($form-
>text('promoter_id',array('value'=>$promoter_id[0])));
 e($form-
>text('agency_id',array('value'=>$agency_id[0])));
 e($form->text('name',array('value'=>
$name[0])));
 e($form-
>text('surname',array('value'=>$surname[0])));


these are the new fields i want to add form same promoter_id.

e($form->text('top_size'));
e($form->text('pants_size'));
e($form->text('bra_size'));
e($form->text('shoe_size'));
e($form->text('hair_colour'));
e($form->text('eye_colour'));

e($form->submit('next >'));
e($form->end());

where i did the mistake..
please help me..

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 cake-php@googlegroups.com
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?hl=en


Re: how to add a relationship whit other key different to the PK

2010-05-12 Thread Martin Westin
Sorry for not noticing your reply until now.

In that case you might get away with simply telling the relationship
that the foreign key is software_id.




On Apr 28, 4:02 pm, Manolet Gmail  wrote:
> the problem is that i need to user the value of software_id for the query.
>
> for example, the HasMany query should be:
>
> SELECT `Mirror`.`id`,   FROM `mirrors` AS `Mirror` WHERE
> `Mirror`.`software_id` = (6)
>
> But how i can put in the query, or in the conditions value add the id of
> software_id??
>
> Thanks in advance
>
> On Wed, Apr 28, 2010 at 4:35 AM, Martin Westin
> wrote:
>
>
>
>
>
> > You can set foreign_key to false and instead use the condition of the
> > relationship. This is usually used for things like User.active => true
> > and simple things like that but I think it can be used for your
> > purpose.
>
> > COme to think of it, I may be wrong. I vaguely recall an RC for
> > Cake1.2 causing problems when the condition is not an array... and I
> > think you might need a string contition.
>
> > On Apr 28, 12:54 am, Manolet Gmail  wrote:
> > > Hi, i have this tables:
>
> > > Software
> > > Reviews
> > > Mirror
> > > Requirements
> > > Published
>
> > > Now, this is the relations:
>
> > > Software Has Many Reviews
> > > Software Has Many Mirrors
> > > Software HABTM Requirements
>
> > > Works fine.
>
> > > The problem is that i need to resume the tables to get a better response
> > > from mysql, the reviews tables have text fields and are classified by
> > > language, so, for the public site i do a Published table for each
> > language,
> > > i mean: language_en language_es language_fr and load the data
> > automatically
> > > into that tables...
>
> > > The Published table is a merge of the Software and Review Table. The PK
> > of
> > > Published table is 'id', and is the same number of the reviews table.
>
> > > I want to establish this relationship: Published.software_id (not the PK)
> > > Has Many Mirrors.software_id
>
> > > The key has a Unique index, the problem is that aparently i can use the
> > > foreign_key attribute when declaring the relationship to set the Mirror
> > > model field, but i cant set the field that i want to use on the Published
> > > model, it uses the PK by default.
>
> > > Is there a way to force it to use other key different to the PK for the
> > > queries?
>
> > > Currently im using afterFind function and works okey, but dont allows me
> > to
> > > use "contain" or "fields".
>
> > > Hope you can understand me and help me
>
> > > thanks for you time,
>
> > > Manolo
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com > >  om>For more options, visit this group athttp://
> > groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: Limitations to plugins for app modularity - are there any left in cake 1.3?

2010-05-12 Thread AD7six


On May 12, 8:08 am, Jamie  wrote:
> I wrote a CMS with CakePHP that uses much the same architecture.
> There's a common core that's used by about 30 sites. The classes all
> have a "Cms" prefix - CmsAppController, CmsAppModel, etc. The classes
> on the individual sites (AppModel, etc.) all extend the core CMS
> classes. They're all empty classes - the functionality is in the CMS
> core.
>If I want to override a function at the local level,

Keymaster - this is the circumstance I meant where if you fix
something in your base/core code - you may have to copy-and-paste your
fix to the client app.

> I can. It
> works quite well. The difference between my setup and yours,
> keymaster, is that I use plugins instead of the 'additional paths'
> setup you've implemented. Basically, there's a core version of each
> plugin, again with Cms prefixes on all the classes. When someone
> installs a plugin on an individual site, it creates empty classes that
> extend those core classes.
>
> It's a handy setup if you're deploying a lot of websites with similar
> functionality. Bugs only fixed in one place (the core), etc. I'm glad
> to see I'm not the only one doing it. :)
>
> As for AD7six's suggestion to use behaviors instead of class
> inheritance, I'm not really sure what benefit that brings to the
> table. Maybe you can explain your rationale, AD?

Just consider how easy it'd be if instead of the tree behavior cake
had a TreeModel you extended.

Of course, the tree behavior, as with most behaviors, is pretty
generic whereas you're both looking at pretty rigid, predefined
functionality you're inheriting as a base.


> logical sense in keymaster's (and my) case. I don't have the benchmark
> stats to prove it, but I'd think that loading a behavior and attaching
> it to a class would be more resource-intensive than simply loading a
> parent class. And Cake already makes good use of inheritance - our
> AppController extends Controller, after all, it doesn't $actsAs
> Controller.

The thing is there's noting in a controller you don't want to inherit,
and you can't extend Object and expect it to just work. I don't know
your apps and I don't know your clients but the problem with using
inheritance as your one weapon (I'm not saying you are) is what do you
do when in ap project you don't want something you're inheriting. E.g.
let's say in your CmsFoo model you've got an afterSave method that
does  and . Your client says "I don't want it to do 
(e.g. send out notifications)". You can do that by overriding the
afterSave method in your (App)Foo model to just do .

It's a simple example of course and there are lots of ways to solve it
but if your base/core functionality is behavior based you don't
include the behavior that does "" and you're done. What's more
if for some reason you want to temporarily disable  you detach
the behavior and your model and application in general works fine
without it.

I think the most important thing to take away from this thread is you
solve the right problem with the right tool in the right place - you
might already be doing that because additional paths and plugins (and
model -> behavior) solve different problems. Probably a good measure
is lines of code. If you end up with less code by reorganizing i'ts
most likely a good idea. If you're going to gain 0 - it's as academic
as you currently perceive it to be - but know the tools/tecniques at
your disposal (keymaster :) )

hth,

AD

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 cake-php@googlegroups.com
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?hl=en