0

Here is my code:

    <?php if (has_permission('messaging')) : ?>
        <li class="side-nav-item">
            <a href="<?php echo site_url('admin/message'); ?>" class="side-nav-link <?php if ($page_name == 'message' || $page_name == 'message_new' || $page_name == 'message_read') echo 'active'; ?>">
                <i class="dripicons-message"></i>
                <span ><?php echo get_phrase('message'); ?></span>
                
            <?php 
            $message_new = $this->db->get_where('message', is_null($result['read_status']))
            ?>
                    <span class="badge badge-danger-lighten badge-pill float-right"><?php echo $message_new;['read_status'] == 0 ?> </span>
                                    
                           
            </a>
        </li>
    <?php endif; ?>

How to count the number of null value on mysql db, table column and view the count as badge notification

I cant retrieve the null data from the table column.

This is the image of my database table 'message' and I want to retrieve the null value on read_status column

badge notification for new unread message

katbori
  • 1
  • 2

1 Answers1

0

Check with is query.

$this->db->query("SELECT count(id) AS not_view FROM message WHERE message.read_status IS NULL OR
message.read_status = ''");
ADyson
  • 57,178
  • 14
  • 51
  • 63