public function get_act_by_id($act_id) { $dbh = DB::m(); $query = <<<SQL SELECT \t* \tFROM \t\toedipus_acts \tWHERE \t\tid = {$act_id} SQL; // print_r($query);exit; $result = mysql_query($query, $dbh); $row = mysql_fetch_array($result); // print_r($row);exit; $act = new Oedipus_Act($row['id'], $row['name'], $row['added'], $row['drama_id']); // Add the scenes to this Act // Get all scenes for this drama $scenes_query = <<<SQL SELECT \t* \tFROM \t\toedipus_scenes \tWHERE \t\tact_id = {$act_id} SQL; // print_r($scenes_query);exit; $scenes_result = mysql_query($scenes_query, $dbh); // Add the scenes to the drama object // if ($scenes_result) { while ($scene_result = mysql_fetch_array($scenes_result)) { $scene_id = $scene_result['id']; $scene = self::get_scene_by_id($scene_id); $act->add_scene($scene); } } return $act; }