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

[eluser]Rowan Wilson[/eluser]
There are many ways to achieve this.

In your if statement in the foreach loop you don't need the parenthesis around empty().

But otherwise, why not check your result is not empty before trying to loop through it?

e.g.

Code:
if($programmes)
{
foreach($programmes as $row)
{
  //..
}
}
else
{
echo 'No Programmes found!';
}


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