Right! To clarify a bit more, create two models (OldRider and
NewRider), and one controller (RidersController). In RidersController,
add this just like [EMAIL PROTECTED] said:

var $uses = array('OldRider', 'NewRider');

Then, in your controller you can access both models. Example, $this-
>OldRider->save(), $this->NewRider->findAll(); By the way, [EMAIL PROTECTED] 
>has a
slight syntax error. It should be:

$this->set('old_riders',$this->OldRider->findAll());
$this->set('new_riders',$this->NewRider->findAll());

Note the parenthesis. Then, in your view, you can use $old_riders and
$new_riders. For more about findAll, check out the API:
http://api.cakephp.org/class_model.html#63ade7d3c6d03c83ab53a224e23ad9dd

On Mar 27, 2:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> You just need to place the following at the start of the controller
> var $uses = array('OldRider','NewRider');
>
> Then you can use both tables to do whatever you want in your actions.
>
> e.g.
>
> $this->set('old_riders',$this->OldRider->findAll();
> $this->set('new_riders',$this->NewRider->findAll();
>
> The you can list the contents of $old_riders and $new_riders in your
> view
>
> On Mar 28, 7:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > I have had the damnedest time with this for some reason.
> > there are no examples that i can find for using more than one table in
> > the same view.
>
> > i have two tables, old_riders and new_riders.
>
> > what i want to do is display the list of new riders and then below
> > that display the list of old riders.
>
> > i cant combine them from what i can tell except if i created two
> > models and one controller, but every time i've tried i get errors to
> > the effect that model doesnt exist for controller ect...ect...
>
> > so is there some place where i can read up on using multiple models in
> > one controller?
>
> > thanks,
> > -=Levi=-


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