Use following Example. and use according to your codes.
$sql="SELECT * from plugin WHERE cat = '$catid' and id <> '$id' order by id ASC LIMIT 30";