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
https://forums.phpfreaks.com/topic/170761-missing-database-table-error/
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.

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.