-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_data.php
49 lines (37 loc) · 1.26 KB
/
get_data.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
<?php
include('koneksi.php');
class InfiniteScroll {
function __construct() {
}
function infinite($connection,$offset,$limit) {
$allData = mysqli_query($connection, "SELECT * FROM goboet_comments");
$countAllData = mysqli_num_rows($allData);
$data = mysqli_query($connection, "SELECT * FROM goboet_comments LIMIT $limit OFFSET $offset");
$countData = mysqli_num_rows($data);
while($row = mysqli_fetch_assoc($data)) {
echo '<div class="card">
'.$countData.'
'.$offset.'
<div class="card-content">
<div class="media">
<div class="media-left">
<figure class="image is-128x128">
<img src="https://bulma.io/images/placeholders/96x96.png" alt="Placeholder image">
</figure>
</div>
<div class="media-content">
<p class="title is-4">'.$row['goboet_judul'].'</p>
<p class="subtitle is-6">'.$row['goboet_comment'].'</p>
</div>
</div>
<div class="content">
test
<br>
</div>
</div>
</div>';
}
}
}
$infiniteObj = new InfiniteScroll();
$infiniteObj->infinite($connection,$_POST['offset'],$_POST['limit']);