There is something strange here. I found where problem is.

In file cake/libs/model/datasources/dbo_source.php on line 588:

if (isset($db) && $db != null) {

This condition is _always_ false on my system. When I changed it to

if (isset($db) || $db != null) {

all begin to work fine.

Seems like a error in my php version. I use php 5.2.0.0. Will try to
download more recent and test with it.


On 13 фев, 23:09, "alexxwiz" <[EMAIL PROTECTED]> wrote:
> I'm glad for you, but my problem is still here :(
> Can someone point me where is my mistake?
>
> On 13 фев, 18:00, "shoesole" <[EMAIL PROTECTED]> wrote:
>
> > Wow. I knew it had to be something easy that I was completely
> > overlooking. Thank you so much Eric. I read the manual chapter on
> > models multiple times, but I guess that part just didn't sink in
> > (maybe next time I should read more carefully). Anyway, Thanks. This
> > is my first shot at Cake and I love it so far, but that really had me
> > confounded.
> >
> > > I have same problem.
> > > Two tables:
> > >
> > > CREATE TABLE `maincats` (
> > >   `id` int(10) unsigned NOT NULL auto_increment,
> > >   `title` varchar(255) default NULL,
> > >   `visible` tinyint(4) NOT NULL default '1',
> > >   `created` datetime NOT NULL,
> > >   PRIMARY KEY  (`id`)
> > > ) ENGINE=MyISAM;
> > >
> > > CREATE TABLE `categories` (
> > >   `id` int(10) unsigned NOT NULL auto_increment,
> > >   `title` varchar(255) default NULL,
> > >   `maincat_id` int(11) default NULL,
> > >   `visible` tinyint(4) NOT NULL default '1',
> > >   `created` datetime NOT NULL,
> > >   PRIMARY KEY  (`id`)
> > > ) ENGINE=MyISAM;
> > >
> > > Two models:
> > >
> > > class Maincat extends AppModel {
> > >     var $name = 'Maincat';
> > >     var $hasMany =
> > > array('Category'=>array('className'=>'Category','foreignKey' =>
> > > 'maincat_id'));
> > >
> > > }
> > >
> > > class Category extends AppModel {
> > >     var $name = 'Category';
> > >
> > > }
> > >
> > > print_r($this->Maincat->findAll());
> > >
> > > returns only maincats content and none sub-categories.
> > >
> > > Array
> > > (
> > >     [0] => Array
> > >         (
> > >             [Maincat] => Array
> > >                 (
> > >                     [id] => 1
> > >                     [title] => Some first
> > >                     [visible] => 1
> > >                     [created] => 2007-02-13 14:39:28
> > >                 )
> > >
> > >         )
> > >
> > >     [1] => Array
> > >         (
> > >             [Maincat] => Array
> > >                 (
> > >                     [id] => 2
> > >                     [title] => Some second
> > >                     [visible] => 1
> > >                     [created] => 2007-02-13 00:00:00
> > >                 )
> > >
> > >         )
> > >
> > > )
> > >
> > > Where is my mistake?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to