Recursion | pagination | show <?php
/* The table structure where posts are stored
CREATE TABLE Announce (
announce_id Int (one) not NULL auto_increment,
board_id smallint (6) Not NULL,
Title varchar not NULL,
Content Tinytext,
Add_time datetime DEFAULT ' 0000-00-00 00:00:00 ' not NULL,
Auth_name varchar is not NULL,
Auth_mail varchar (40),
Hit_count smallint (6) Not NULL,
Bytes Mediumint (9) Not NULL,
parent_id tinyint (4) not NULL,
AUTH_IP varchar () not NULL,
top_id Int (one) not NULL,
Return_count tinyint (4) not NULL,
Face Char (3) is not NULL,
PRIMARY KEY (announce_id),
KEY board_id (board_id),
KEY top_id (top_id)
);
*/
<body>
<?php
You need to connect to the database here
You can add pagination to your needs
$query = "Select announce_id from announce where top_id= ' 0 ' ORDER by announce_id DESC";
$result _top=mysql_query ($query, $dbconnect);
echo "<ul>\n";
while ($myrow _top=mysql_fetch_array ($result _top)) {
Show_announce ($myrow _top[announce_id],0);
}
echo "</ul>\n";
Mysql_free_result ($result _top);
?>
</body>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.