|
require("connect.php");
$id = 0;
$r = mysql_query("SELECT * FROM sch_chief_article ORDER BY cha_name LIMIT 0,1");
if ($r) {
if ($row = mysql_fetch_assoc($r)) {
if (empty($row['cha_file']))
$id = $row['cha_id'];
}
}
if (isset($_GET['id'])) $id = intval($_GET['id']);
$r = mysql_query("SELECT * FROM sch_chief_article ORDER BY cha_name");
if ($r) {
print " ";
while ($row = mysql_fetch_assoc($r)) {
if ($row['cha_id']==$id)
print "- $row[cha_name] \n";
else {
if (!empty($row['cha_file']))
print "- $row[cha_name] \n";
else
print "- $row[cha_name] \n";
}
}
print " ";
if ($id>0) {
$ra = mysql_query("SELECT * FROM sch_chief_article WHERE cha_id=$id");
if ($ra) {
if ($rowa = mysql_fetch_assoc($ra))
print $rowa['cha_text'];
}
}
}
?>
|
|