Zkuste toto :)
<?php
function schools_post_function()
{
global $wpdb;
$result = $wpdb->get_results("SELECT postid from wp_school_post WHERE `postid` IS NOT NULL");
if(count($result) == 0)
{
echo "not filled";
}
else
{
echo "filled";
}
}
?>