cluelessnoob Posted August 18, 2009 Share Posted August 18, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170761-missing-database-table-error/ Share on other sites More sharing options...
trq Posted August 18, 2009 Share Posted August 18, 2009 Going to need allot more information than that I'm afraid. You might at least tell us what framework your talking about. Quote Link to comment https://forums.phpfreaks.com/topic/170761-missing-database-table-error/#findComment-900577 Share on other sites More sharing options...
cluelessnoob Posted August 18, 2009 Author Share Posted August 18, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170761-missing-database-table-error/#findComment-900584 Share on other sites More sharing options...
jcombs_31 Posted August 18, 2009 Share Posted August 18, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/170761-missing-database-table-error/#findComment-900828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.