Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 4th, 2005, 7:12 AM   #1
stakeknife
Newbie
 
Join Date: Mar 2005
Posts: 16
Rep Power: 0 stakeknife is on a distinguished road
Textarea, PHP & MySQL

okay, strange error, i'm writing a script (some may know this already ) where the user can add/edit/delete articles and category's to the database. Im currently working on the edit part, the others are working...

i have a strange error on the edit article part

i use this line to assign the text held in the row 'body' in the article table to a textarea in HTML

Body: <textarea cols="65" rows="15" name="body" value ="<? echo "$body" ?>"></textarea>

In the database the type is of type text. When the textarea appears no text is inside of it, it is completely empty.

However, if i change the input type to a text box it shows the text held in the database. Like the following:

Title: <input type="text" name="body" value="<? echo "$body"?>">

any ideas?

should i change the mysql data type to longtext or blob?

havent a clue at the moment
stakeknife is offline   Reply With Quote
Old Apr 4th, 2005, 8:31 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
try:

[PHP]
echo "<textarea cols=\"65\" rows=\"15\" name=\"body\">" . $body . "</textarea>";
[/PHP]

the values for a textarea goes in between the two textarea tags. That's probably what's wrong.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC