Here are my database tables:

CREATE TABLE `events_signups` (
  `id` int(10) NOT NULL auto_increment,
  `member_id` int(10) NOT NULL,
  `event_id` int(10) NOT NULL,
  `event_option_id` int(10) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(50) NOT NULL,
  `phone` varchar(50) NOT NULL,
  `total_cost` varchar(10) NOT NULL,
  `payment_id` int(10) NOT NULL,
  `confirmed` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB;


CREATE TABLE `events_options_signups` (
  `id` int(10) NOT NULL auto_increment,
  `event_option_id` int(10) NOT NULL default '0',
  `event_signup_id` int(10) NOT NULL default '0',
  `quantity` int(10) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;



On Mar 9, 8:56 pm, nhathoang nhathoang <computing1...@gmail.com>
wrote:
> dear Sabfly
>
> According to me,  you don't wrong in this case, I haven't  discovered why
> the information of EventsSignUp don't link with the one of
> EventsOptionsSignUp, please send me your database to me to help you test
> again.
>
> 2009/3/9 nhathoang nhathoang <computing1...@gmail.com>
>
> > dear Sanfly,I hope you can post your database to  forum, this is more
> > convenience for us
>
> > 2009/3/9 Sanfly <san...@gmail.com>
>
> >> Hi All
>
> >> Ive been trying to get a hasMany association working, but It just wont
> >> seem to work.  The pages which use this model simply wont load when I
> >> try to run them
>
> >> I have two databases:  events_signups, events_options_signups
>
> >> Each signup can have many different options, which is why I have the
> >> table events_options_signups to link them.
>
> >> The field in events_options_signups table has a field event_signup_id
> >> where I store the id of the events_signups entry it belongs to
>
> >> In my EventsOptionsSignup model I have a belongsTo association which
> >> works great:
>
> >> var $belongsTo = array(
> >>                        'EventsSignup' =>
> >>                                array('className' => 'EventsSignup',
> >>                                                'foreignKey' =>
> >> 'event_signup_id',
> >>                                )
>
> >>        );
>
> >> But I cant get the hasMany association to work when going the other
> >> way, and i need to be able to extract that data when searching by
> >> EventsSignup
>
> >> var $hasMany = array(
> >>                        'EventsOptionsSignup' =>
> >>                                array('className' => 'EventsOptionsSignup',
> >>                                                'foreignKey' =>
> >> 'event_signup_id',
> >>                                ),
> >>        );
>
> >> Is there anything im doing wrong that is obvious to anyone?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to