-
Notifications
You must be signed in to change notification settings - Fork 0
/
newReleaseclient.php
113 lines (72 loc) · 1.96 KB
/
newReleaseclient.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html>
<head>
<title>DreamLand</title>
<link rel="stylesheet" href="stylesheet.css">
</head>
<body >
<nav class ="topnav">
<a style="text-decoration: none" href="clienthome.php">Home</a>
<a href="clientcat.php">Categories</a>
<a href="bestsellerclient.php">Best Sellers</a>
<a href="newReleaseclient.php">New Releases</a>
<a href="p3.php">Contact</a> <a href="about3.php">About</a>
<a href="logout.php"> Logout </a> </nav>
<?php
if(!isset($_SESSION))
{
session_start();
} ?>
<br>
<br>
<center>
<img src="newr.jpg" width="900"height="400" >
</center>
<table style="margin-left:auto;margin-right:auto;">
<th></th>
<div class="class" >
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "toystoredb";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//else echo "connected successfully";
$sql = "SELECT image, price FROM newreleases";
$result = $conn->query($sql);
$counter=0;
$w="300";
$h="300";
$m="middle"; $i=0;
if ($result->num_rows > 0) {
echo "<tr>";
while($row = $result->fetch_assoc()) {
// echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
$s=$row["image"];
$p[$i]=$row["price"];
echo "<td>"."<img src='$s' width='$w' height='$h' >"."</td>" ;
$counter++;
if($counter%3==0) {
echo"</tr>";
// echo "Price : '$p[0]' "."Price : '$p[1]' "."Price : '$p[2]' ";
echo "<td>"."Price : $p[0] "."</td>". "<td>"."Price : $p[1] "."</td>". "<td>"."Price : $p[0] "."</td>" ."</tr>" ;
} //counter loop
$i++;
}
} else {
echo "0 results";
}
?>
</div>
</table>
</body>
<footer class ="topnav">
<a href="privacypolicy.html">Privacy Policy</a>
<a href="terms.ofuse.html">Terms of Use</a>
</footer>
</html>