Show DB data [closed]

0

I'm creating a movie site that should show the trailers and such. I want to add a movie to the script to dynamically organize the screen.

Example: in the database we will have the movie name, photo and trailer.

How do I get started? If you can not help me, at least tell me what to look for.

    
asked by anonymous 23.02.2015 / 17:39

1 answer

1

Take into account that when updating your database, the data will already be updated when viewing your movie query ... Now, everything depends on how you are doing to display your data, to organize the table automatically According to the% w / o% you should display on each line, you can do this:

$varConsulta = ConsultaFilmes();
    $i=0;
    if ($varConsulta) {
    echo "<table style='margin-left:2%;'><tr>";
        foreach ($varConsulta as $lin) {
            $linhas .= "<td style='vertical-align: middle;text-align: center;'>Filme<br />[IMAGEM][INFORMAÇÕES REFERENTES AO FILME]</td>";

            echo $linhas;

            $i++;
            //Aqui é feito a mágica!!
            if ($i % $qtdDeRegistros == 0) {
                echo "</tr>";
                echo "<tr>";
            }
        }

        echo "</tr></table>";
    }else{
        echo "<h3> Nenhum filme dísponivel.</h3>";
    }
}
    
23.02.2015 / 18:02