Regarding custom queries

2007-07-09 Thread reeta

Hi everybody.I have a question ,if anybody know then please solve my
query.
I have a model class named 'Customer' and controller class of it
'Customers_controller'.
earlier i was using query() in my controller class but after reading a
post now i m using it in my model class like --

In controller class:-
$this-Customer-changepass($pass,$id);
where $pass is password and $id is id.

now in model class:-
function changepass($pass,$id)
{
 $this-query(UPDATE customers SET password='$pass' WHERE
id='$id');
return;
}

This is working well,but if i want to run query on another table then
how can i do this?
Suppose i want to run update query on inventory table in customer
model , then how will i do this in model class?is there any other
changes will occur except query() ?

Sorry for my English because my English is not so good.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Regarding custom queries

2007-07-09 Thread reeta

Hi AD ! thanks for the help but i want to know if i want to run query
on another model then how could i do this?suppose i want to run
query() from inventory table in customer model class ,then how could i
do this?and another question is i m not getting value for last insert
id.There is a function named as getLastInsertId(),but it is not giving
result.

On Jul 9, 2:37 pm, AD7six [EMAIL PROTECTED] wrote:
 On Jul 9, 11:06 am, reeta [EMAIL PROTECTED] wrote:
 snip

  now in model class:-
  function changepass($pass,$id)
  {
   $this-query(UPDATE customers SET password='$pass' WHERE
  id='$id');

 Why are you using query instead of save or saveField..?
 If you don't want to use the features of the framework, why use the
 framework?

  This is working well,but if i want to run query on another table then
  how can i do this?

 You call save (or whatever) on the other model.

 hth,

 AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: regarding javascript

2007-07-05 Thread reeta

Thanks,i had to implement this in cakephp.I got the answer through
your another post.again thanks.

On Jul 2, 1:45 pm, Grant Cox [EMAIL PROTECTED] wrote:
 What does this have to do with CakePHP?

 Search google for javascript button submit form and javascript
 button click.  Come back here if you have a CakePHP specific question.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



regarding javascript

2007-07-02 Thread reeta

hi,this is reeta.I m new to cakephp.can anyone tell me that how can i
set multiple action
using javascript on more than one buttion.Suppose I hv 2 submit
buttons,first one is save and another one having name goback.I want to
give action on these buttons, and they are on a single form.If anybody
know then plz answer me.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---