<?php
if($_GET['cat'] == "all"){
$sql = "SELECT * FROM $newstable ORDER BY timestamp $newsorder LIMIT $from ,$nppage";
}else{
$sql = "SELECT * FROM $newstable WHERE catid = '$catid' ORDER BY timestamp $newsorder LIMIT $from ,$nppage";
}
$result = mysql_query($sql)
or die ("Couldn't execute query.");
?>