Forum Moderators: coopster
Every other one I read I could see made sense and was a great help but I can't figure out how you would loop through a recordset from a database and stick it into an html table without using html within the php code.
Can anyone post an example of the right way to do this?
Cheers.
echo '<table>';
echo '<tr><td>this is a waste</td></tr>';
echo '</table>';
this is obviously a very small example. I see lots of code that has massive amounts of html printed out via php.
this would be simpler and makes more sense
?>
<table>
<tr><td>this isn't a waste</td></tr>
</table>
<?
escaping from the parser to output tons of html. I skip in and out for doing single vars or small opperations. If I need to create a table using a loop then I may have php echo'ing chunks of unprocessed html.
and don't worry Steerpike, we all squirm when we read that thread ;)
[edited by: jatar_k at 11:54 pm (utc) on Aug. 22, 2006]
Top 100 Signs That I Am Writing Spaghetti Code in PHP [webmasterworld.com]
it is a great thread