How to retrieve a text from my DB and display it in textarea

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarah89
    New Member
    • Feb 2012
    • 5

    How to retrieve a text from my DB and display it in textarea

    Hi all ^^

    i want to display a text that i have in my DB in textarea, so, i use a query to select that text from the database and it work fine.
    then i use the following statment:

    Code:
     Print " <textarea name='bio' maxlength='370'  id='bio' rows='10' cols='44' name='bio' value=".$info['bio'] ." > </textarea> ";
    but it dose not work!! and i get the textarea empty!:(((

    P.S: i used
    Code:
     Print $info['bio'];
    and my text printed ok ^^

    i think it something wrong with my using "value" ! but i couldn't find any other why.

    any aides??

    thank you so much ^^ <3
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    that's because a textarea does not have a value attribute (though its DOM representation has a value property). put the text between start and end tag.

    Comment

    • sarah89
      New Member
      • Feb 2012
      • 5

      #3
      thank you so much ^^
      i am really thankful for your help <3333

      Comment

      • Bharat383
        New Member
        • Aug 2011
        • 93

        #4
        Code:
        <textarea><?php echo $row['your_text_filed_name']; ?></textarea>
        Last edited by Dormilich; Apr 16 '12, 09:23 AM. Reason: Please use [CODE] [/CODE] tags when posting code.

        Comment

        Working...