Avatar of shruti A
shruti A

asked on 

Undefined index: message_total this error is occuring in php

$sql1="select a.message_total,b.message_sent from 
batch_id, count(phone) message_total from to_numbers  group by batch_id
 ) a left outer join
batch_id, count(phone) message_sent from message_sent  group by batch_id
   ) b
   on a.batch_id=b.batch_id 
   where a.batch_id=".$max_id."";

$out = '';  

      $result1 = mysqli_query($db, $sql1);
      while($row = mysqli_fetch_row($result1))  
        $out .='<table class="table table-bordered"><tr><td width="30%"><label>message_total</label></td><td width="70%">'.$row['message_total'].'</td></tr><tr><td width="30%"><label>message_sent</label></td><td width="70%">'.$row['message_sent'].'</td></tr></table>';  

Open in new window

the below error is coming

\nNotice: Undefined index: message_total in C:\\xampp\\htdocs\\whatsapp_message_sender\\importData.php on line 256
\nNotice: Undefined index: message_sent in C:\\xampp\\htdocs\\whatsapp_message_sender\\importData.php on line 256
\n<table class="table table-bordered"><tr><td width="30%"><label>message_total</label></td><td width="70%"></td></tr><tr><td width="30%"><label>message_sent</label></td><td width="70%"></td></tr></table> success "

please let me know the solution

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon