<?php
Require ("bbs/config.inc.php");
Connect, select Database
$link = mysql_connect ($dbhost, $dbuser, $DBPW) or die (' could not connect: '. Mysql_error ());
mysql_select_db ($dbname) or die ("could not elect database");
$fid =$_get["FID"];
Intercept character length
$length = 36;
Prevent Chinese garbled
mysql_query ("Set names ' gb2312 '");
Execute SQL query
$query = "Select Tid,subject from Cdb_threads where fid= ' $fid ' ORDER by lastpost desc LIMIT 10";
$result = mysql_query ($query) or Die ("Query failed:". Mysql_error ());
Display results in HTML
while ($myrow = Mysql_fetch_row ($result))
{
printf ("Document.writeln" (\ "<li><a href=\\\" bbs/viewthread.php?tid=%s&extra=page=1\\\ "target=\\\" _ blank\\\ ">%s</a></li>\"); \ n ", $myrow [0],cutstr ($myrow [1], $length," ... "));
}
Releasing the result set
Mysql_free_result ($result);
Close connection
Mysql_close ($link);
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service