Jump to content

Recommended Posts

I'm trying to figure out when I echo a row (using mysql_fetch_array, then using $row['column name']) it outputs as a single line, ignoring the page breaks that exist in the database. When I make a <textarea> and set the echo as the value, it includes the breaks. Is there another way to output the spaces or will I have to edit the database values?

 

Thanks in advance  :)

 

Here is a part from the form:

<?php
$result = mysql_query("SELECT * FROM system WHERE UserID='$id'");
$row = mysql_fetch_array($result);
?>
  <tr>
    <td>Name</td>
    <td><?php echo $row['Name']; ?></td>
  </tr>

Link to comment
https://forums.phpfreaks.com/topic/179230-echoing-mysql-query-with-page-breaks/
Share on other sites

they are newline characters. In plain text (which text areas are) line breaks are caused by new lines. In html they are caused by the line break tage (<br />) Marcus is correct, you should look into the nl2br() function

 

edit: oh nvm then too late

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.