My php skills are not very good but I have been trying to create the 'if else' clause without much success it still brings up the same error message, I have tried the following:
<?php
$total = count($records);
$nocol = 3;
$norows = ceil($total / $nocol);
for ($i=1; $i <= $norows; $i++) {
$cell = 0;
echo "<tr>";
for($col=1; $col <= $nocol; $col++) {
echo "<td>";
if
($col == 1) {
$cell += $i;
if (isset($records[$cell - 1])) {
} else {
$records[$cell - 1] = NULL;
}
echo '<strong class="navtext">'.$records[$cell - 1]['ret_name'].'</strong><br />';
echo $records[$cell - 1]['ret_add1'].'<br />';
echo $records[$cell - 1]['ret_add2'].'<br />';
echo $records[$cell - 1]['ret_town'].'<br />';
echo $records[$cell - 1]['ret_county'].'<br />';
echo $records[$cell - 1]['ret_pcode'].'<br />';
echo $records[$cell - 1]['ret_phone'].'<br />';
echo $records[$cell - 1]['ret_email'].'<br />';
echo $records[$cell - 1]['ret_web'].'<br />';
} else {
$cell += $norows;
echo '<strong class="navtext">'.$records[$cell - 1]['ret_name'].'</strong><br />';
echo $records[$cell - 1]['ret_add1'].'<br />';
echo $records[$cell - 1]['ret_add2'].'<br />';
echo $records[$cell - 1]['ret_town'].'<br />';
echo $records[$cell - 1]['ret_county'].'<br />';
echo $records[$cell - 1]['ret_pcode'].'<br />';
echo $records[$cell - 1]['ret_phone'].'<br />';
echo $records[$cell - 1]['ret_email'].'<br />';
echo $records[$cell - 1]['ret_web'].'<br />';
}
echo"</td>";
}
echo"</tr>";
}
and this:
if (isset($records[$cell - 1])) {
echo '<strong class="navtext">'.$records[$cell - 1]['ret_name'].'</strong><br />';
echo $records[$cell - 1]['ret_add1'].'<br />';
echo $records[$cell - 1]['ret_add2'].'<br />';
echo $records[$cell - 1]['ret_town'].'<br />';
echo $records[$cell - 1]['ret_county'].'<br />';
echo $records[$cell - 1]['ret_pcode'].'<br />';
echo $records[$cell - 1]['ret_phone'].'<br />';
echo $records[$cell - 1]['ret_email'].'<br />';
echo $records[$cell - 1]['ret_web'].'<br />';
} else {
$cell += $norows;
echo '<strong class="navtext">'.$records[$cell - 1]['ret_name'].'</strong><br />';
echo $records[$cell - 1]['ret_add1'].'<br />';
echo $records[$cell - 1]['ret_add2'].'<br />';
echo $records[$cell - 1]['ret_town'].'<br />';
echo $records[$cell - 1]['ret_county'].'<br />';
echo $records[$cell - 1]['ret_pcode'].'<br />';
echo $records[$cell - 1]['ret_phone'].'<br />';
echo $records[$cell - 1]['ret_email'].'<br />';
echo $records[$cell - 1]['ret_web'].'<br />';
} else {
$records[$cell - 1] = NULL;
}
}
echo"</td>";
}
echo"</tr>";
}
I have also tried
if (isset($records[$cell - 1])) {
} else {
echo '';
}
None of which has worked which is probably due to my lack of understanding of what I'm doing. Would it be possible to point me in the right directions thank you for your time any advice would be appreciated.