-
Notifications
You must be signed in to change notification settings - Fork 1
/
movielist.php
73 lines (58 loc) · 2.18 KB
/
movielist.php
1
2
3
4
5
6
7
8
9
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
include_once "connection/conn.php";
?>
<?php include_once "file/header.php"; ?>
<section class="contentsection clear">
<?php include_once "file/sidebar.php"; ?>
<article class="maincontent clear">
<div class="content">
<div class="catagoryoption">
<h2>Movie List</h2>
<?php
if (isset($_GET["movie_id"])) {
$movie_id=$_GET["movie_id"];
$sql="DELETE from tbl_movie where movie_id='$movie_id'";
$query=mysqli_query($connection,$sql);
if ($query !=false) {
echo "<span class='success'>Delete successfully<span>";
}
}
?>
<table class="mytable">
<tr>
<th width="10%">Serial No.</th>
<th width="10%">Movie_id</th>
<th width="10%">Movie Name</th>
<th width="60%">Image</th>
<th width="10%">Category_id</th>
<th width="50%">Action</th>
</tr>
<?php
$sql="SELECT * FROM tbl_movie";
$query=mysqli_query($connection,$sql);
if ($query !=false) {
$i=1;
while ($value=mysqli_fetch_array($query)) {
$i++;
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $value["movie_id"] ?></td>
<td><?php echo $value["movie_name"] ?></td>
<td><img src="<?php echo $value["image"] ?>" width="50px"></td>
<td><?php echo $value["category_id"] ?></td>
<td>
<a href="editmovie.php?movie_id=<?php echo $value['movie_id'] ?>">Edit</a> ||
<a href="?movie_id=<?php echo $value['movie_id'] ?>" onclick="return confirm('Do you wnat to delete this ?')">Delete</a>
</td>
</tr>
<?php }} ?>
</table>
</div>
</div>
</article>
</section>
<?php include_once "file/footer.php"; ?>
</div>
</body>
</html>