Re: printf -- no newlines, tabs
| From: | Carroll Barrett | Date: | Thu, 22 Jun 2000 17:28:55 +0000 |
| Subject: | Re: printf -- no newlines, tabs | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-578@lists.php.net to get a copy of this message | ||
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