-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjokes.php
62 lines (48 loc) · 1.85 KB
/
jokes.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jokes</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-uWxY/CJNBR+1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous">
<!-- <link rel="stylesheet" href="css/reviews.css"> -->
</head>
<body>
<div class="container py-5">
<h1 style="text-align:left; margin-bottom:40px;">Jokes</h1>
<div class="row">
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "bookhub";
$conn = new mysqli($servername,$username, $password, $dbname);
//check connection
if ($conn->connect_error) {
die("Connection failed".$conn->connect_error);
}
$query = "SELECT * FROM jokes";
$query_run = mysqli_query($conn, $query);
$check_ques = mysqli_num_rows($query_run) > 0;
if ($check_ques) {
while($row = mysqli_fetch_array($query_run)) {
?>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h5 class="card-title"> <?php echo $row['jokesList']; ?> </h5>
<p card-text><?php echo $row['sub']; ?> </p>
</div>
</div>
</div>
<?php
}
} else {
echo "No questions found!";
}
?>
</div>
</div>
</body>
</html>