Ok i understand what you have told me, but as i was going along i came across some more code that didn't quite make sense to me.
I guess i should show what my tables look like, it will probably help me more than anything...
This is the 'movie' table:
|movie_id|movie_name|movie_type|movie_year|movie_leadactor|movie_director|
movie_id = int(11) auto increment
movie_name = varchar(255)
movie_type = tinyint(2)
movie_leadactor = int(11)
movie_director = int(11)
This is the 'people' table:
|people_id|people_fullname|people_isactor|people_isdirector|
people_id = int(11) - auto increment
people_fullname - varchar(25) - (this is the actor/director full name)
people_isactor - tinyint(1) - (1 = actor, 0 = not actor)
people_isdirector - tinyint(1) - (1 = director, 0 = not director)
This is the 'movietype' table:
|movietype_id|movietype_label|
movietype_id = tinyint(11) - auto increment
movietype_label = varchar(100) - (this is the genre i.e comedy, drama, etc...)
So where the code actually starts doing anything is when it begins pulling all the information from the movie table
$query=”SELECT * FROM movie”;
$results=mysql_query($query)
or die(mysql_error());
so if i understand at this point $query is the query parameters stored in a variable and the mysql_query($query) is sending those parameters to the server, the results are then stored in a temporary array ($results)... am i on the right track?
What i don't understand, and this book doesn't illustrate very well is how this script is associating movie_leadactor and movie_director from the 'movie' table with the people_id field in the 'people' table.