Re: How do I merge 2 tables

2009-08-23 Thread Farjad Habib
sory my bad.

On Sun, Aug 23, 2009 at 8:08 PM, simplesi  wrote:

>
>
>
> Farjad Habib wrote:
> >
> > http://book.cakephp.org/view/78/Associations-Linking-Models-Together
> >
> > go through this and u ll get an idea
> AFAICT there's nothing in there to show how loop through all the records in
> one table and update another table as appropriate :)
>
> I tried modifying the
>
> foreach ($issues as issue) loop in my index view of Issues and I can
> extract
> all associated Change.detail fields using a inner loop of
>
> $totaldetail = '';
> foreach($issue['Change'] as $subchange) {
>   if (!empty($subchange['detail'])) {
>  $totaldetail = $totaldetail . $subchange['detail'];
>   }
> };
>
> but I don't seem able to make Issue.alldetails = $totaldetail and save each
> updated record :(
>
> regards
>
> Simon
>
>
> --
> View this message in context:
> http://www.nabble.com/How-do-I-merge-2-tables-tp25103063p25103642.html
> Sent from the CakePHP mailing list archive at Nabble.com.
>
>
> >
>


-- 
Farjad Habib
BS 2011
LUMS

--~--~-~--~~~---~--~~
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 do I merge 2 tables

2009-08-23 Thread Farjad Habib
http://book.cakephp.org/view/78/Associations-Linking-Models-Together

go through this and u ll get an idea

On Sun, Aug 23, 2009 at 5:55 PM, simplesi  wrote:

>
>
> I'm re-coding a simple helpdesk application and I'd like to merge 2 tables
> into one.
> I could probably do this using a raw MySQL query but I'd like to know if it
> is possible to do it using a one-time controller/view action.
>
> My main table is Issues and my associated table is Changes where each issue
> has many changes.
> I'd like to loop through each Issue and find all assoicated Change.details
> and put them into one Issue.alldetails field.
>
> Any ideas please?
>
> regards
>
> Simon
>
>
>
> --
> View this message in context:
> http://www.nabble.com/How-do-I-merge-2-tables-tp25103063p25103063.html
> Sent from the CakePHP mailing list archive at Nabble.com.
>
>
> >
>


-- 
Farjad Habib
BS 2011
LUMS

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



uploading file to directory

2009-07-27 Thread Farjad

i found $form->file() method to upload a file but i dont know how to
specify the path to which the file should b uploaded!

i call the method, i specify the path of file to be uploaded then
submit form but dont know where file goes

can anyone help and explain the process of file method and parameters
that it takes.
--~--~-~--~~~---~--~~
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: HABTM

2009-07-26 Thread Farjad Habib
thanx majna and Martin

On Sat, Jul 25, 2009 at 6:45 PM, Martin Kirchgessner  wrote:

>
> If you always want the same Course fields returned by any Student
> request, you may also use the "fields" option of the association
> definition.
>
> see http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM
>
>
> Martin
>
> On 24 juil, 14:52, Farjad  wrote:
> > i m defining a habtm relation between students table and courses table
> >
> > now i want that when i call students to fetch the data particular
> > fields of course table are fetched.
> >
> > currently all the fields of course table are fetched.
> >
> > can someone help or guide
> >
>


-- 
Farjad Habib
BS 2011
LUMS

--~--~-~--~~~---~--~~
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: many to many (habtm) between three tables

2009-07-26 Thread Farjad

there is one table keystage, second is subject and third is topics


now i have join table with fields keystageid, subjectid and topicid

i want to fetch the record such that the all the topics against
keystageid x and subjectid y are fetched...

now how to do this in cake

On Jul 23, 10:08 pm, Marcelo Andrade  wrote:
> On Wed, Jul 22, 2009 at 7:58 AM, Farjad wrote:
>
> > is there any way to implementhabtmrelation between threetables
>
> Could you give us an example of this kind o relationship...?
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.com
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



HABTM

2009-07-24 Thread Farjad

i m defining a habtm relation between students table and courses table

now i want that when i call students to fetch the data particular
fields of course table are fetched.

currently all the fields of course table are fetched.

can someone help or guide
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



call javascript function from ajax

2009-07-23 Thread Farjad

i m writing a code like this

link(
 $post['Student']['rollno'], array(
 'controller' => 'students', 'action' => 'view', 
$post['Student']
['id'],'loaded' => 'alert("test")'), array(
 'update' => 'post', 'position' => 'top')
); ?>


but javascript function is not working

can any one tell me how to call javascript function from ajax in cake
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



many to many (habtm) between three tables

2009-07-22 Thread Farjad

is there any way to implement habtm relation between three tables

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---