Welcome Guest, Not a member yet? Register   Sign In
Check if table is empty
#1

[eluser]Volkof[/eluser]
Hi,

Can anyone guide me on how to check if a returned table is empty?
I used this:

Code:
<?php
   foreach($programmes as $row){
    if(!(empty($row))){
     echo '<a class="'.$row-&gt;programmeID.'" href="/index.php/test/getModules/'. $row-&gt;programmeID.'">';
     echo '<b>'.$row->programmeName.'</b><br/>';
     echo '<br/></a>';  
    }else{
     echo 'No Programmes found!';
    }
   }
  ?&gt;

but the if(!(empty($row))) does not seems to work.


Messages In This Thread
Check if table is empty - by El Forum - 12-21-2012, 02:12 AM
Check if table is empty - by El Forum - 12-21-2012, 03:48 AM
Check if table is empty - by El Forum - 12-21-2012, 05:22 AM
Check if table is empty - by El Forum - 12-21-2012, 06:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB