Hi, i have been studying Beginning PHP, Apache, ... and all went smoothly uptill the asignment in chapter 3 that sais "Create a php program that prints the lead actor and director for each movie in the database"
I tried to do that with a mysql link but i figured that wasn't possible because of the makeup of the main table. So i eventualy just went ahead and looked how it was suposed to be done.
The problem is; some elements in the "answer code" are not covered in the preceding chapters.
Below is a piece of the code, the thing that i can't figure out about this and similiar blocks is the ($leadactor) "argument?" in the function. Because the variable isn't mentioned anywhere else in the script nor does it match a field name. Passing arguments hasn't been covered so my understanding of it could be limited.
Anyone here that can demistify this?
//create function to get lead actor
function_ get_leadactor($leadactor) {
global $actorname
$query2="SELECT people_fullname FROM people
WHERE people.people_id=$lead_actor";
$results=mysql_query($query2) or die(mysql_error());
$rows=mysql_fetch_array($results);
extract ($rows);
$actorname=people_fullname;
}