I assume catagory "6" whould be in reference to the id_parent in your query.
To exclude that, just be more verbose.
$query = "SELECT * FROM ".$dbinfo["table_ads"]." WHERE id_parent=$category_id AND id_parent!=6 ORDER BY date_placed DESC LIMIT 0,$num";
...or since it would appear that catagory_id is actually set in a variable, I imagine you'll have to find some other work around.
But, for more details, you'll need to show more code since your post was a little ambiguous. But, I think you'll get it on your own.