Textarea retrieves PHP with 12 extra spaces

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Leao
Forum Commoner
Posts: 49
Joined: Mon Aug 21, 2006 8:57 pm
Location: London

Textarea retrieves PHP with 12 extra spaces

Post by Leao »

I've noticed that when my textarea retrieves text from the mysql database it automatically adds 12 spaces at the end of the text for some reason. This is annoying as if I click to upload whatever is in the textarea it is sent to my database and the text on the database will also have 12 spaces at the end of it.

Any ideas? Attached is the code for the textarea.

Leao

Code: Select all

<form method="post" action="meetthecommunity.php">
          <div align="center">
            <p>
              <textarea name="meetthecommunity" cols="43" rows="14" id="meetthecommunity"><?php
mysql_connect("mysql","username","password") or die(mysql_error());
mysql_select_db("database_text") or die(mysql_error()); 

$result = mysql_query("SELECT * FROM grid")
or die(mysql_error());  

$row = mysql_fetch_array( $result );

echo $row['meetthecommunity'];

?>
            </textarea>
            </p>
            <p>
              <input type="submit" value="upload text">
              </p>
          </div>
        </form>
Last edited by Leao on Tue Aug 22, 2006 3:19 pm, edited 1 time in total.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Code: Select all

</textarea>
123456789012
Leao
Forum Commoner
Posts: 49
Joined: Mon Aug 21, 2006 8:57 pm
Location: London

Post by Leao »

Thank you. Forgive me for my incompetence!

Leao
Post Reply