Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################# query ###################################
- select f.title, f.release_year, a.name, a.act_img
- from film f, actor a, film_actor r
- where a.actor_id = r.actor_id and r.film_id = f.film_id and a.actor_id = '1'
- #############################################################################
- <!DOCTYPE html>
- <html>
- <head>
- <title>Test Modal</title>
- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- </head>
- <body>
- <div class="row col-sm-8">
- <table class="table">
- <thead>
- <tr>
- <th scope="col">Title</th>
- <th scope="col">Date</th>
- <th scope="col">Poster</th>
- <th scope="col">Name</th>
- <th scope="col">Image</th>
- </tr>
- </thead>
- </table>
- </div>
- <?php
- require 'chiabre_conn.php';
- $sql = "select f.title, f.release_year, f.image, a.name, a.act_img
- from film f, actor a, film_actor r
- where a.actor_id = r.actor_id and r.film_id = f.film_id and a.actor_id = '1'";
- $result = mysqli_query($conn, $sql);
- $data = [];
- if ($result){
- while ($row = mysqli_fetch_array($result)){
- $data[] = $row;
- echo '
- <div class="row col-sm-8">
- <table class="table">
- <tbody>
- <tr>
- <td scope="row">'.$row['title'].'</td>
- <td scope="row">'.$row['release_year'].'</td>
- <td scope="row"><img src="movie_gallery/' . $row['image'] . '" height="50" width="40" class="img-thumnail" /></td>
- <td scope="row">'.$row['name'].'</td>
- <td scope="row"><img src="act_gallery/' . $row['act_img'] . '" height="50" width="40" class="img-thumnail" /></td>
- </tr>
- </tbody>
- </table>
- </div>
- ';
- }
- }
- return $data;
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement