Php Endif Endforeach Endwhile

[Solved] Php Endif Endforeach Endwhile | Php - Code Explorer | yomemimo.com
Question : php endif endforeach endwhile

Answered by : unsightly-unicorn-b5uvihe4rf2r

<table>
<? while ($record = mysql_fetch_assoc($rs)): ?> <? if (!$record['deleted']): ?> <tr> <? foreach ($display_fields as $field): ?> <td><?= $record[$field] ?></td> <? endforeach; ?> <td> <select name="action" onChange="submit"> <? foreach ($actions as $action): ?> <option value="<?= $action ?>"><?= $action ?> <? endforeach; ?> </td> </tr> <? else: ?> <tr><td colspan="<?= array_count($display_fields) ?>"><i>record <?= $record['id'] ?> has been deleted</i></td></tr> <? endif; ?>
<? endwhile; ?>
</table>

Source : https://stackoverflow.com/questions/4600419/endforeach-in-loops | Last Update : Sun, 07 Nov 21

Answers related to php endif endforeach endwhile

Code Explorer Popular Question For Php