- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
$film_id = $row["film_id"];
// $collections_result = mysql_query("SELECT title FROM films");
$collections_result = mysql_query("SELECT c.collection_name, l.film_id FROM collections AS c, films_collections AS l, films AS f WHERE f.film_id = $film_id");
while($coll_row = mysql_fetch_array($collections_result)) {
$col_arr[] = $coll_row["film_id"];
$heading = $coll_row["collection_name"];
}
// echo "<pre>";
// print_r($collections_row);
// echo "</pre>";
if (mysql_num_rows($collections_result)) {
echo '
<h2>'.$heading.'</h2>
<ul class="grid">
';
// $col_arr[] = $film_id;
// print_r($col_arr);
$collections_films_result = mysql_query("SELECT title, url, description FROM films WHERE film_id IN(".implode(",",$col_arr).")");
$collections_films_row = mysql_fetch_array($collections_films_result);
do {
if (iconv_strlen($collections_films_row["description"],'UTF-8')>95) {
$more_desc = mb_substr($collections_films_row["description"],0,95,'UTF-8').'...';
}
echo '
<li>
<a href="./seeing.php?id='.$collections_films_row["url"].'">
<img src="./oblojki/'.$collections_films_row["url"].'.jpg" >'.$collections_films_row["title"].'</a>
<small>'.$more_desc.'</small>
</li>
';
}
while($collections_films_row = mysql_fetch_array($collections_films_result));
}