Get Number Of Blank Colums From Db in Percentage

  • 3 years-4 months

    Get Number Of Blank Colums From Db in Percentage

    • Category : php
    • Viewed : 64 times
    • Posted On :
    • Posted by : Guley

    Fetch blank colum information from database in %.

    <div class="progress">
    
    <?php
    $result = mysql_query("SELECT * FROM `register_users` where `uemail`='$email'");
    while($row = mysql_fetch_row($result)){
        $empty_count = 0;
        $count = count($row);
        for($i = 0; $i < $count; $i  )
            if($row[$i] === '' || $row[$i] === 'NULL')
                $empty_count  ;
       
    
    ?>
      <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?php echo  ''.((int)(100*(1-$empty_count/($count-1)))).'' ?>"
      aria-valuemin="0" aria-valuemax="100" style="width:30%;border: 1px solid #ccc !important;">
     <?php    echo  ''.((int)(100*(1-$empty_count/($count-1)))).'% complete'; ?>
      </div>
      <?php } ?>
    </div>

     

Report this or Ask your own question

Your Answer

When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.