Menu
I’d like to ask is this correct to put “if/else” statement inside other “if/else” statement? For example:
[code=php]
<?php
$count=mysql_num_rows($result);
if($_POST[‘Submit’])
{
foreach($_POST[‘id’] as $id)
{
…
}
if($result1){
…
}
}
else
{
?>
…
<?php
while($rows=mysql_fetch_array($result))
{
?>
…
<?php
}
?>
…
<?php
// SHOULD IT BE HERE?
if($count == 0) {
echo “Table is empty”;
}
else {
echo “Table loaded”;
}
?>
…
<?php
}
mysql_close();
?>