Associated model won't load

2010-02-16 Thread Furuno
Okay, so, I have two models called Program and Subject, here's the classes : program.php ?php class Program extends AppModel { var $hasMany = 'Subject'; } ? subject.php ?php class Subject extends AppModel { var $belongsTo = 'Program' } ? And the controllers :

Re: how to change an string to int

2010-02-16 Thread Furuno
Well, you can use the intval() function from PHP, example : var $strings = intval('100'); Also check the PHP docs from http://php.net/docs.php On 16 Feb, 16:56, lenin kumar ksleninku...@gmail.com wrote: dear all, i am new to cakePHP  please help me to solve my issue i am inserting some

Re: Associated model won't load

2010-02-16 Thread Furuno
16, 9:37 am, Furuno furunom...@gmail.com wrote: Okay, so, I have two models called Program and Subject, here's the classes : program.php ?php class Program extends AppModel {         var $hasMany = 'Subject';} ? subject.php ?php class Subject extends AppModel

Re: Associated model won't load

2010-02-16 Thread Furuno
1.2.6... On 17 Feb, 01:57, andy sum...@gmail.com wrote: Do you know what version of CakePHP you are running? On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote: Nope... :( Just to make sure, I tried that once again with : $this-set('subjects', $this-Subject-find('all')); still

Re: Associated model won't load

2010-02-16 Thread Furuno
in the post :) Enjoy,    John On Feb 16, 9:01 pm, Furuno furunom...@gmail.com wrote: 1.2.6... On 17 Feb, 01:57, andy sum...@gmail.com wrote: Do you know what version of CakePHP you are running? On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote: Nope... :( Just to make sure

Re: Associated model won't load

2010-02-16 Thread Furuno
] in the Subjects controller!    John On Feb 16, 9:49 pm, Furuno furunom...@gmail.com wrote: well, I'm afraid it's only in the post... On 17 Feb, 02:38, John Andersen j.andersen...@gmail.com wrote: Are you missing a semicolon in this code? [code] ?php class Subject extends AppModel

Re: Associated model won't load

2010-02-16 Thread Furuno
creates these kind of problems :) Maybe copy/paste the Subject model into a post!    John On Feb 16, 10:20 pm, Furuno furunom...@gmail.com wrote: tried that too... still no luck... Really, I think I've exhausted a lot of methods already but still can't fix it... On 17 Feb, 03:09, John

Re: Associated model won't load

2010-02-16 Thread Furuno
and it saved a lot of time when I want to be sure that I retrieve not only one model but also associated models from up to several levels of associations. Hope you find the issue!!! and tell us what the issue was, so we too may learn :) Enjoy,    John On Feb 16, 10:36 pm, Furuno furunom...@gmail.com

Re: Associated model won't load

2010-02-16 Thread Furuno
and upgrading my hardware :). Just FYI, in the previous version, all models uses the same controllers, the AdminsController, should I revert back to that? And of course, it works like a charm, only not so elegant to do so... On 17 Feb, 05:29, Furuno furunom...@gmail.com wrote: WIll try once I got

Quotes in options array

2010-02-03 Thread Furuno
Ok, so I want to pass an image from my custom file browser to CKEditor. Here, the code I'm using to draw the image in the file browser : ?php echo $html-image('pool/' . $image, array('width' = 155, 'onclick' = 'window.opener.CKEDITOR.tools.callFunction(' . $func_num . ', \'/mysite/img/pool/' .

Automatically add related data after insert

2009-09-12 Thread Furuno
Hello. Let's say that I want to create an application to manage inventories in each stores. I have the following tables : Table : products - id - name Table : stores - id - name Table : inventories - id - product_id - store_id - qty Every time a new product or store is added. The application