|
Posted by ward on 03/01/06 17:28
On 1 Mar 2006 06:22:40 -0800, "frizzle" <phpfrizzle@gmail.com> wrote:
>before printing the results from the DB, you should call nl2br() (
>NewLine To Break )
>
> print nl2br( $result['text'] );
>
>More info at http://php.net/nl2br
>
>Frizzle.
I'll visit the link, thanks.
I looked at the source of the output page. And the breaks are there
including new lines and spaces between new lines.
BTW, what are the technical terms for...
Topic A
This is topic A <--- new line but no space (I guess like <BR>)
and
Topic A
<--- new line and space (I guess like <p>)
This is topic A.
So I guess a question is, what is stored to represent a new line AND a
new line with a space.
I guess it's \n for a new line but is it \n\n for a space?
Ok, the next question is, where do I call this function?
On $result from $result = mysql_query ($query); // Run the query.
or
somewhere within this statement...
$bg = '#eeeeee'; // Set the background color.
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee'); // Switch the
background color.
echo '<tr valign="top" bgcolor="' . $bg . '">
<td align="left"><a href="edit_task_v5.php?id=' .
$row['task_id'] . '">Edit</a></td>
<td align="left">' . $row['task_task_no'] . '</td>
<td align="left">' . $row['icaotask_no'] . '</td>
<td align="left">' . $row['task_usaction'] . '</td>
</tr>
';
Thanks.
Ward
Navigation:
[Reply to this message]
|