topical media & game development
basic-php-04-movie-details-rev03.php / php
<?php
takings, difference = cost;
if (difference = substr(font_color = 'red';
" . difference > 0) {
profit_or_loss = "difference . "m";
} else {
profit_or_loss = "Broke even";
}
return "<font color=\"profit_or_loss . "</font>";
}
/* Function to get the director's name from the people table */
function get_director() {
global director;
movie_director'";
query_d)
or die(mysql_error());
results_d);
extract(director = movie_leadactor;
global query_a = "SELECT people_fullname " .
"FROM people " .
"WHERE people_id='results_a = mysql_query(row_a = mysql_fetch_array(row_a);
people_fullname;
}
_GET['movie_id'] . "'";
query, movie_table_headings=<<<EOD
<tr>
<th>Movie Title</th>
<th>Year of Release</th>
<th>Movie Director</th>
<th>Movie Lead Actor</th>
<th>Movie Running Time</th>
<th>Movie Health</th>
</tr>
EOD;
while (result)) {
row['movie_name'];
row['movie_director'];
row['movie_leadactor'];
row['movie_year'];
row['movie_running_time']." mins";
row['movie_takings'];
row['movie_cost'];
//get director's name from people table
get_director();
//get lead actor's name from people table
get_leadactor();
}
movie_takings, page_start =<<<EOD
<html>
<head>
<title>Details and Reviews for: movie_details =<<<EOD
<table width="70%" border="0" cellspacing="2"
cellpadding="2" align="center">
<tr>
<th colspan="6"><u><h2>movie_table_headings
<tr>
<td width="33%" align="center">movie_year</td>
<td align="center">leadactor</td>
<td align="center">movie_health</td>
</tr>
</table>
<br>
<br>
EOD;
detailed_movie_info =<<<EOD
movie_details
detailed_movie_info;
mysql_close();
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.