0
您好,我从我的数据库中检索项目时遇到问题,我想只检索一次数据,并且如果某个项目已在之前的值中检索到不显示该项目不要回显以前值中记录的项目
PHP
$select_query = "select * from posts";
$run_query = mysql_query($select_query);
while($row=mysql_fetch_array($run_query)){
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$post_date = $row['post_date'];
$post_author = $row['post_author'];
$post_image = $row['post_image'];
$post_keywords = $row['post_keywords'];
$post_content = $row['post_content'];
HTML
<h1 class="centru">The Posts Author are: <?php echo $post_author; ?>
</h1>
EX:在本页面会显示:
JHON
玛丽亚
JHON
亚历
JHON
我想是这样的
JHON
玛丽亚
亚历