Re: PHP/MySQL learning project

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



News.Php.Net wrote:
Hi everyone!

In trying to learn PHP and MySQL, I'm trying to create a web-based database
application that will keep track of my movies.  I have five tables (shown in
the graphic).  I'm trying to be able to display the results of the tables
with one movie title, all of the actors associated with it, and all of the
genre's associated with it.

Of course I can do the query:
  Select *
  From MovieMain, MovieActor, MovieGenre, Genre, Actors
  Where MovieMain.MovieID=MovieGenre.MovieID
  And MovieMain.MovieID=MovieActor.MovieID
  And MovieActor.ActorID=Actors.ActorID
  And MovieGenre.GenreID=Genre.GenreID

But that displays the movie title for every genre and actor there is.  Is
there another way to perform the query that will display the title once, and
all of the associated genres and all of the associated actors for that
movie?  Or should I try to code it using PHP to find the movie title first?

Thanks in advance, everyone!




There's no way to do that in SQL alone. You should do it in PHP. :-)


--
paperCrane <Justin Patrin>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux