Jump to content

Missing Database Table Error


cluelessnoob

Recommended Posts

I get this error when I try to load the scaffold view.

I have tables called artists and comics in the comic database and models

call artist.php and comic.php. i have no idea what I'm doing wrong.

 

Missing Database Table

 

Error: Database table artists_comics for model ArtistsComic was not found.

Link to comment
Share on other sites

Sorry I've been at this for too long. I'm using Cakephp. I have a database called comicdb and a tables called comics and artist. I have a model and controller for called comic and comics_controller respectively. As well as similarly named models and controllers for my six tables. the comics table has a foreign key for each table here is the code for the model:

<?
class Comic extends AppModel {
var $name = 'Comic';
var $belongsTo = array('User');
var $hasOne = array(
        'Artist',
        'Author',
        'Rating',
        'Publisher'
); 
}
?>

 

and the controller:

<?
class ComicsController extends AppController {
var $name = 'Comics';
var $scaffold;
}
?>

 

I'm not sure what other information might be necessary.

Link to comment
Share on other sites

artists_comics would be a join table for... you guessed it, artists and comics.  The join table would be for a hasAndBelongsToMany relationship, which is a many to many relationship. 

 

Without more information about your database and model creations it is hard to see where you went wrong.  What does your artist model look like?

 

Do you have a join table?  Is it a many to many relationship?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.