I have 3 tables files,users,categories
CREATE TABLE `categories` (
`id` int(11) unsigned NOT NULL auto_increment,
`name` varchar(64) collate utf8_bin NOT NULL default '',
`priority` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=29
;
CREATE TABLE `files` (
`id` int(6) NOT NULL auto_increment,
`user_id` int(6) NOT NULL default '0',
`album_id` int(4) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`hash` varchar(32) collate utf8_bin NOT NULL default '',
`filename` varchar(255) collate utf8_bin NOT NULL default '',
`category_id` int(2) NOT NULL default '0',
`comment` varchar(255) collate utf8_bin default NULL,
`tag` varchar(125) collate utf8_bin NOT NULL default '0',
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin
AUTO_INCREMENT=3545 ;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(50) collate utf8_bin NOT NULL default '',
`password` varchar(32) collate utf8_bin NOT NULL default '',
`name` varchar(50) collate utf8_bin NOT NULL default '',
`email` varchar(100) collate utf8_bin NOT NULL default '',
`last_visit` datetime NOT NULL default '0000-00-00 00:00:00',
`group_id` int(10) unsigned NOT NULL default '0',
`active` tinyint(1) unsigned NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`,`username`),
KEY `group_id` (`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3
;
its work ok
---
<?php class File extends AppModel {
var $name = 'File'; // required for php4 installs
var $belongsTo = 'User';}
?>
--
when i add Category
--
<?php class File extends AppModel {
var $name = 'File'; // required for php4 installs
var $belongsTo = 'User,Category';}
?>
---
than i have a error
Fatal error: Cannot instantiate non-existent class: category in
/home/andriu/cake/libs/model/model_php4.php on line 460
4 queries took 4 msNr Query Error Affected Num. rows Took
(ms)
1 DESC `files` 23 23 1
2 DESC `users` 10 10 1
3 DESC `groups` 4 4 1
4 DESC `permissions` 4 4 1
whats wrong witch category ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---