Hi,
I need help with this php script. The bit of code below is to show a list of shows and their dates. It shows the From and To dates but a lot of the shows are only on for one night so they show, for example: Sat 05 Oct - Sat 05 Oct.
How can I change it so that if a show is only on one night it will only show the one date, eg. Sat 05 Oct.
PHP Code:function list_all_movies() // show all movies
{
// query
$query="SELECT id, title, qft1_date_from, qft1_date_from_timestamp, qft1_date_to, qft1_date_to_timestamp FROM movies ORDER BY id"; // find all bad words
database_connect(); //connect to the database
$result=mysql_query($query); // Executes the query
$rows_number=mysql_num_rows($result); //count the number of rows/bad words
echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"1\" width=\"100%\">";
for ($i=0; $i<$rows_number; $i++) // get info from evry record and display it into the table
{
$row_array=mysql_fetch_row($result); // Fetching the array
$id=$row_array[0];
$title=$row_array[1];
$qft1_date_from=$row_array[2];
$qft1_date_from_timestamp=$row_array[3];
$qft1_date_to=$row_array[4]; // we use $package_type_ but not $package_type because of global variables problem.
$qft1_date_to_timestamp=$row_array[5];
// visualization conversion
$visualize_qft1_from=date("D d-M",$qft1_date_from_timestamp);
$visualize_qft1_to=date("D d-M",$qft1_date_to_timestamp);
//adjustig the hours visualization
$qft1_hours="<font size=\"-1\"> $visualize_qft1_from - $visualize_qft1_to; </font>";
if ($qft1_date_from== "0000-00-00" or $qft1_date_to== "0000-00-00") {$qft1_hours="";}
echo
"
<tr>
<td width=\"400\">
<p><font size=\"-1\"><a href=\"description.php?id=$id\">$title</a></font></p>
</td>
<td width=\"542\">
<p><a href=\"description.php?id=$id\">$qft1_hours</a></p>
</td>
</tr>
";
} // end of for
echo "</table>";
}




Reply With Quote