Sort: [Newest Entry] or [Alphabet]
$txtsort=$_REQUEST['sort'];
$txtrec=$_REQUEST['rec'];
if ($txtsort=="alpha") { $txtsort="subject"; }
else { $txtsort="stardate desc"; }
$sql[0] = "select no_id,stardate,subject from ".$dbprefix."knowledge where status='1' order by ".$txtsort;
if (! $res[0]=mysql_query($sql[0], $dbh)) { echo mysql_error(); return 0; }
$x=0;
while ($row[0] = mysql_fetch_array($res[0])) {
$l[$x]=$row[0][0];
echo " ".$row[0][2]." ";
$x++;
} ?> |
|
if ($txtrec != 0) {
include('../admin/config.php');
$sql[1] = "select no_id,subject,stardate,contents from ".$dbprefix."knowledge where status='1' and no_id='".$txtrec."'";
if (! $res[1]=mysql_query($sql[1], $dbh)) { echo mysql_error(); return 0; }
$y=0;
while ($row[1] = mysql_fetch_array($res[1])) {
echo " ".$row[1][1]." ";
echo "Posted Stardate: ".$row[1][2].$row[1][3]." ";
echo "".$row[1][4];
$y++;
}
} else {
echo "Choose from the Index on the left panel to open a Record ";
}
?> |