gpt4 book ai didi

php - 在页面上显示新记录数

转载 作者:行者123 更新时间:2023-11-30 21:47:50 25 4
gpt4 key购买 nike

我想在重新加载页面后在我的 phpmyadmin 数据库页面上显示新条目(记录)的确切数量。我在网上看,但找不到任何有用的东西。也许有人可以帮助我。这是页面的代码:

<?php
header("Refresh: 120");
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="verzoekstyle.css">
<title>Verzoekpagina DJ</title>
</head>
<body id="body">
<div id="tabel">
<?php
$con = mysqli_connect('database','username','password');

if (!$con)
{
echo 'Geen verbinding met server';
}

if (!mysqli_select_db($con, 'eventqy179_verzoeken'))
{
echo 'Database niet geselecteerd';
}

$sql = "SELECT * FROM info";
$query = mysqli_query($con,$sql);

if(!$query)
{
echo 'Onbekende fout gevonden';
}

echo '
<table class="table">
<tr>
<th><h3><b>Artiest</b></h3></th>
<th><h3><b>Titel</b></h3></th>
<th><h3><b>Verwijderen</b></h3></th>
</tr>';

while ($row = mysqli_fetch_array($query))
{
echo '<tr>';
echo '<td><h3>'.$row['artiest'].'</h3></td>';
echo '<td><h3>'.$row['titel'].'</h3></td>';
echo '<td><h3><a href=delete.php?id='.$row['id'].'>Verwijderen</a></h3></td>';
echo '</tr>';
}

echo '</table>';

?>
</div>
</body>
</html>

最佳答案

已经找到另一种方法,只需ORDER BY id DESC。问题因此得到解答

关于php - 在页面上显示新记录数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48601938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com