
/seville-spain-AMERIABROAD0421-2ff3c4ba0560465092fc9c4a972d95a4.jpg)
How to setup another database connection using Linked Tables feature, besides using the existing main database connection. Cannot add foreign key constraintĠ9:40:56 CREATE TABLE m4l_movie_genre (movie_id INT(11),genre_id INT(11),įOREIGN KEY (genre_id) REFERENCES m4l_genre (ID) )Įrror Code: 1215. By using this PHPMaker project, then you will learn: 1. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 īut when I try to create the movie_actor OR movie_genre I getĬREATE TABLE `m4l_movie_actor` (movie_id INT(11), actor_id INT(11),įOREIGN KEY (actor_id) REFERENCES m4l_actors (ID) )Įrror Code: 1215.

) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 įOREIGN KEY (movie_id) REFERENCES m4l_movies (ID),įOREIGN KEY (actor_id) REFERENCES m4l_actors (ID)įOREIGN KEY (genre_id) REFERENCES m4l_genre (ID) Ok trying to follow along with suggesting made by Phil I've removed actors, genre from movies tale & created movies_genre & movies_actors DROP TABLE IF EXISTS `m4l_movies` I'm sure it has to do with either the way I've joined the tables but I can't figure out where I'm going wrong. Some how the RATING value is doing it right but I can't get NAME or GENRE to do it correctly. Secondly, I need to know how to either create a lookup or some other method to convert the NAME & GENRE back to their corresponding text values. Here is the out put I get: -|įirstly this view should return more than 200 records. INNER JOIN m4l_actors ON m4l_movies.Actors = m4l_actors.ID INNER JOIN m4l_genre ON m4l_movies.Genre = m4l_genre.ID JOIN m4l_movierating ON m4l_movierating.ID = m4l_movies.Rating & I've created a View: SELECT m4l_movies.ID AS ID,

) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 ) ENGINE=InnoDB AUTO_INCREMENT=202 DEFAULT CHARSET=utf8 ) ENGINE=InnoDB AUTO_INCREMENT=232 DEFAULT CHARSET=utf8 That receives input for a form which has values from a these lookup tables: CREATE TABLE `m4l_actors` ( ) ENGINE=MyISAM AUTO_INCREMENT=115 DEFAULT CHARSET=utf8 I have one master table: CREATE TABLE `m4l_movies` ( I'm doing my first work in PHP/MySQL & I need help.
