my table is named as pank
i know how to connect to the database but following programming is giving me problem
my table is:
id| stream | title | cast | director
1 | stream1 | title of the movie1 | cast1 | director1
2 | stream1 | title of the movie2 | cast2 | director2
3 | stream2 | title of the movie3 | cast3 | director3
My PHP script:
$query = "SELECT * FROM pank";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
echo "<h2>".'Stream : ', $row['stream'], "</h2>",
"<br />",
"<h3>", 'Title of the movie : ', $row['title'], "</h3>",
"<h3>", 'cast : ', $row['cast'], "</h3>",
"<h3>", 'director : ', $row['director'], "</h3>"
;
}
I want output as:
stream1
title of the movie1
cast1
director1
title of the movie2
cast2
director2
stream 2
title of the movie3
cast3
director3
the above php is giving output as:
stream1
title of the movie1
cast1
director2
stream1
title of the movie2
cast2
director2
stream2
title of the movie 3
cast3
director3
I just don't want output labeled as stream1 again second time