Re: SEARCHING for an answer...
| From: | brian | Date: | Tue, 11 Sep 2007 22:48:40 +0000 |
| Subject: | Re: SEARCHING for an answer... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261985@lists.php.net to get a copy of this message | ||
Jay Blanchard wrote:
So Jason you learned three valuable lessons today. a. plan your code (use paper and pencil or something like it) b. always account for security c. comment properlyI'll add two more: d: Check the source that your script outputs. Send it to the W3C validator (WebDeveloper Firefox extension is one of your bestest ever friends). e: (my personal opinion) Using echo() to spit out HTML will lead to *much* heartache and gnashing of teeth. Put a closing PHP tag ("?>") in there and let the parser spit out the markup without echo(). either: -- snip -- while($row = mysql_fetch_assoc($result)) { ?> <tr> <td><?= $row['FName'] ?></td> <td><?= $row['LName'] ?></td> <td><?= $row['Add1'] ?></td> ... <?php } -- snip -- or: -- snip -- while($row = mysql_fetch_assoc($result)) { ?> <tr> <td><?php echo $row['FName'] ?></td> <td><?php echo $row['LName'] ?></td> <td><?php echo $row['Add1'] ?></td> ... <?php } -- snip -- or, as i said, use a template system. brian