RE: [PHP-DB] printf -- no newlines, tabs
| From: | Arthur Yeo | Date: | Thu, 22 Jun 2000 17:29:36 +0000 |
| Subject: | RE: [PHP-DB] printf -- no newlines, tabs | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-580@lists.php.net to get a copy of this message | ||
The skinny of it is this:
don't confuse yourself between
a) what is slapped into the HTML code to format the code itself
b) versus what is interpreted by the browser for displaying the HTML itself
>-----Original Message-----
>From: Carroll Barrett [mailto:cbarrett@inalt.com]
>Sent: Thursday, June 22, 2000 10:29 AM
>To: php-db@lists.php.net
>Subject: Re: [PHP-DB] printf -- no newlines, tabs
>
>
>Randy,
>
>>I can't seem to get printf to do newlines or tabs. Is there
>anything wrong
>>with the following code?
>>
>>while ($myrow = mysql_fetch_array($result)) {
>> printf("%s\t%s\t%s\n\", $myrow["fname"],
>> $myrow["lname"],
>>$myrow["email"]);
>
>I *think* that the browser is just displaying each tab as a
>single space. I *know* that the browser is displaying the
>newline as a space. You could display the rows using an HTML
>table, like this:
>
>echo "<TABLE>";
>while ($myrow = mysql_fetch_array($result)) {
> printf("<TR><TD>%s<TD>%s<TD>%s",
> $myrow["fname"],
>$myrow["lname"],
>$myrow["email"]);
>echo "</TABLE>";
>
>Regards,
>Carroll Barrett
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail:
>php-list-admin@lists.php.net
>