I ran into a similar problem, and found an interesting solution that took
care of it right away. Clear out the contents of your /app/tmp/cache/models
folder, and then try again and it should recognize your database tables if
they exist.

In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)

On Fri, Jun 20, 2008 at 03:10, leo <[EMAIL PROTECTED]> wrote:

>
> I guess if bake doesn't work, Cake can't see the tables. Make sure
> they are defined in the same database as users (!)
>
> Check your database config file in app/config - make sure that the
> stated user has access to the tables.
>
> Make sure that the model filenames are correct and correctly located
> (although the error message suggests all is correct there)
>
>
> On 20 Juny, 02:18, KURT <[EMAIL PROTECTED]> wrote:
> > Below is the codes that I have done.
> >
> > <?php
> > class Product extends AppModel
> > {
> >         var $name = 'Product';
> >         var $belongsTo = array ('Dealer' =>
> >                 array(
> >                         'className'  => 'Dealer',
> >                         'conditions' => '',
> >                         'order'      => '',
> >                         'foreignKey' => 'dealer_id'
> >                 )
> >         );}
> >
> > ?>
> >
> > <?php
> > class Dealer extends AppModel
> > {
> >         var $name = 'Dealer';
> >         var $hasMany = array ('Product' =>
> >                 array(
> >                         'className'  => 'Product',
> >                         'conditions' => '',
> >                         'order'      => '',
> >                         'foreignKey' => 'dealer_id'
> >                 )
> >         );}
> >
> > ?>
> >
> > <?php
> > class ProductsController extends AppController
> > {
> >         var $scaffold;}
> >
> > ?>
> >
> > <?php
> > class DealersController extends AppController
> > {
> >         var $scaffold;}
> >
> > ?>
> >
> > The tables 'dealers' and 'products' exists.
> >
> > My problem is when I access 
> > 'http://localhost/cookup/dealers'and<http://localhost/cookup/dealers%27and>
> > 'http://localhost/cookup/products', cake give me an error 'Error:
> > Database table dealers for model Dealer was not found.' or 'Error:
> > Database table products for model Product was not found.'.
> >
> > Furthermore, when I try to use bake, I cannot bake dealer and
> > products.
> >
> > I have another table called 'users' and that table is fine.
> >
> > What is my problem?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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