how would i code a "<br>" after each output of the data?
<?php $result = mysql_query("SELECT * FROM joesauto",$rbc); while ($myrow = mysql_fetch_array($result)) { echo $myrow['make']; //Need line break here?!!?!? } ?>
while ($myrow = mysql_fetch_array($result)) { echo $myrow['make'] . '<br />'; }
In case you didn't know, wherever you have a '<br>', you can also use '<br />'. It renders the same on browsers and assures forward-compliance for XML parsing tools.
That works with any of the HTML tags like that. i.e. <h1/>, <input name="foo" value="bar" /> etc.
Originally posted by mrmufin while ($myrow = mysql_fetch_array($result)) { echo $myrow['make'] . '<br />'; } In case you didn't know, wherever you have a '<br>', you can also use '<br />'. It renders the same on browsers and assures forward-compliance for XML parsing tools. [/B]
Originally posted by mrmufin
In case you didn't know, wherever you have a '<br>', you can also use '<br />'. It renders the same on browsers and assures forward-compliance for XML parsing tools. [/B]
Uh....hehe...not a clue😕
but it works, so THANK YOU! 😉
piersk, assuring forward-compatible XML compliance means (at least) adhering to this minimal set of rules:
Tags which have optional closing tags, such as <td> should be closed with their previously 'optional' closing tag. So no <td>'s without accompanying </td>'s. It's just plain old good coding practice to close what you open, anyway. If you don't want to close your paragraph tags, etc., you may elect to write them as shown in Rule 2, (as <p />) but it's not recommended.
HTML tags which have no closing tag, such as <meta> or <img> or <br> must be written as <meta ... /> or <img ... /> or <br />. This prevents XML parsers from being 'confused' about these 'standalone' tags.
Tags must match case such as <table></table>, NOT <TaBlE></tAble>. Though XML can handle either upper or lowercase tags, WML (wireless markup language) requires lowercase tags.
Options inside tags must be written as option="value". Most (if not all) browsers will gleefully respect <table border=0> and <table border='0'>, however, the basic rules of XML say the correct way to write it is <table border="0">.
Tags must be properly nested. Again, most browsers will gleefully render <b><u>bold underlined text</b></u> just as you 'intend', but this will 'confuse' a basic XML parser which will expect <b><u>bold underlined text</u></b>. Again, this is IMHO just good HTML coding practice, anyway.
HTML comments are a no-no. This is the toughest one for me to respect, since I have a tendency to stick the following lines at the top and bottom of my included PHP files for debugging purposes:
// At the top of each included file: printf("\n<!-- start of included file %s -->\n", basename(__FILE__)); // At the bottom of each included file: printf("\n<!-- end of included file %s -->\n", basename(__FILE__));
There's plenty of information about XML compliance on several websites: www.w3c.org (The worldwide web consortium), www.xml.com. www.htmlgoodies.com has a fairly simple introduction to XML.
Any clearer?
Tch.... theres always one knowitall...😉