« Return to the main article
Why have you put all the HTML in echo statements? I would think something like the below is much more readable, especially with a syntax highlighting editor.
<table width="100%"> <tr><td>Subject</td><td>Category</td><td>Created</td></tr> <?php while ( $rows = mysql_fetch_array($entries) ) { ?> <tr> <td><?= $rows[ 'subject' ] ?></td> <td><?= $rows[ 'category' ] ?></td> <td><?= date("F d, Y ",strtotime($rows[ 'time_created' ])) ?></td> </tr> <?php } ?> </table>
Don't know how it's going to come out when I save, but hopefully will be visible.
Why have you put all the HTML in echo statements? I would think something like the below is much more readable, especially with a syntax highlighting editor.
<table width="100%"> <tr><td>Subject</td><td>Category</td><td>Created</td></tr> <?php while ( $rows = mysql_fetch_array($entries) ) { ?> <tr> <td><?= $rows[ 'subject' ] ?></td> <td><?= $rows[ 'category' ] ?></td> <td><?= date("F d, Y ",strtotime($rows[ 'time_created' ])) ?></td> </tr> <?php } ?> </table>
Don't know how it's going to come out when I save, but hopefully will be visible.