如何显示来自sqlite db和动画的最新数据以查看更多信息?
How to show the latest data from sqlite db and animation to see more?
你好,我想这样做,它从 sqlite 数据库中获取数据,只显示最新的数据,但它会显示所有数据并制作动画,因此当滚动它时,它会一个一个地显示更多
pls help me and pls don't devote this question I can't ask more questions then I really need help I'm trying to fund from one whole day but didn't find any so I asked as this is a good community
Code
<?php
$conn = new PDO("sqlite: Review.db");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$result = $conn->query("SELECT * FROM Review ORDER BY id DESC LIMIT 1");
while ($row = $result->fetch()) {
print_r($row['Review']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="index.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap" rel="stylesheet">
<title>Social Cabin</title>
</head>
<body>
<nav>
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<ul class="nav-links">
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Projects</a></li>
</ul>
</nav>
<section id="landing">
<img src="cabbin.jpeg" id="landing-image">
<h1>Social Cabin</h1>
</section>
<section>
<div class="join" >
<h3>Why Should You Join Us?</h3>
<p>School is the place where we learn to read and write. It is the most crucial place for a student, and it helps us to learn new things. The teachers are always helpful and teach us important things in life. We must always be regular to school as missing classes can lead to problems during exams. Schools teach us how to be consistent, punctual, and obedient. It also makes us better human beings so that we can treat our elders with respect. Most of what we learn is a result of the learning imparted by our teachers.
</p>
<section>
<hr class="fir" >
<h3 class="about" >About Us</h3>
<p id="consider" >Considering that the chain’s main draw is high quality food at low prices, it makes sense that customers might question how Trader Joe’s can afford to charge less than other brands. This short explanation answers that question, and it’s easy to see how it could be very effective at drawing new customers to their local store.</p>
<img src="team.jpg" class="team " >
</section>
<section class="all" >
<div class="slidercontainer">
<div class="showSlide fade">
<img src="1.png" />
</div>
<div class="showSlide fade">
<img src="3.png"/>
</div>
<div class="showSlide fade">
<img src="2.png"/>
</div>
<div class="showSlide fade">
<img src="3.png"/>
</div>
<!-- Navigation arrows -->
<a class="left" onclick="nextSlide(-1)">❮</a>
<a class="right" onclick="nextSlide(1)">❯</a>
</div>
</section>
</section>
</div>
</section>
<script src="index.js"></script>
</body>
</html>
那么,您需要创建一个 'load more' 按钮,按下时会加载更多数据,对吗?
您可以使用 ajax 来实现。
您需要将 php 代码更改为一个新文件,例如,加载 more.php。在此文件中,您将拥有 php 代码,这些代码将 return 数据,如果被调用,将 return 更多数据。
这个教程对我来说就像一个魅力:https://www.webscodex.com/2020/08/load-more-pagination-with-php-and.html
你好,我想这样做,它从 sqlite 数据库中获取数据,只显示最新的数据,但它会显示所有数据并制作动画,因此当滚动它时,它会一个一个地显示更多
pls help me and pls don't devote this question I can't ask more questions then I really need help I'm trying to fund from one whole day but didn't find any so I asked as this is a good community Code
<?php
$conn = new PDO("sqlite: Review.db");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$result = $conn->query("SELECT * FROM Review ORDER BY id DESC LIMIT 1");
while ($row = $result->fetch()) {
print_r($row['Review']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="index.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap" rel="stylesheet">
<title>Social Cabin</title>
</head>
<body>
<nav>
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<ul class="nav-links">
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Projects</a></li>
</ul>
</nav>
<section id="landing">
<img src="cabbin.jpeg" id="landing-image">
<h1>Social Cabin</h1>
</section>
<section>
<div class="join" >
<h3>Why Should You Join Us?</h3>
<p>School is the place where we learn to read and write. It is the most crucial place for a student, and it helps us to learn new things. The teachers are always helpful and teach us important things in life. We must always be regular to school as missing classes can lead to problems during exams. Schools teach us how to be consistent, punctual, and obedient. It also makes us better human beings so that we can treat our elders with respect. Most of what we learn is a result of the learning imparted by our teachers.
</p>
<section>
<hr class="fir" >
<h3 class="about" >About Us</h3>
<p id="consider" >Considering that the chain’s main draw is high quality food at low prices, it makes sense that customers might question how Trader Joe’s can afford to charge less than other brands. This short explanation answers that question, and it’s easy to see how it could be very effective at drawing new customers to their local store.</p>
<img src="team.jpg" class="team " >
</section>
<section class="all" >
<div class="slidercontainer">
<div class="showSlide fade">
<img src="1.png" />
</div>
<div class="showSlide fade">
<img src="3.png"/>
</div>
<div class="showSlide fade">
<img src="2.png"/>
</div>
<div class="showSlide fade">
<img src="3.png"/>
</div>
<!-- Navigation arrows -->
<a class="left" onclick="nextSlide(-1)">❮</a>
<a class="right" onclick="nextSlide(1)">❯</a>
</div>
</section>
</section>
</div>
</section>
<script src="index.js"></script>
</body>
</html>
那么,您需要创建一个 'load more' 按钮,按下时会加载更多数据,对吗?
您可以使用 ajax 来实现。
您需要将 php 代码更改为一个新文件,例如,加载 more.php。在此文件中,您将拥有 php 代码,这些代码将 return 数据,如果被调用,将 return 更多数据。
这个教程对我来说就像一个魅力:https://www.webscodex.com/2020/08/load-more-pagination-with-php-and.html