1. Список говнокодов пользователя peterzubkoff

    Всего: 1

  2. PHP / Говнокод #19351

    −2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 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));
    
    
    }

    peterzubkoff, 26 Января 2016

    Комментарии (0)