Re: Help w/ quotes/html and data from MySQL

From: Date: Tue, 23 Jan 2001 23:30:18 +0000
Subject: Re: Help w/ quotes/html and data from MySQL
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-36285@lists.php.net to get a copy of this message
After I sent this message I looked at the code again. I saw the error as obvious as daylight. It's working great now. Thanks..... ----- Original Message ----- From: "Steve Edberg" <sbedberg@ucdavis.edu> To: "Shane McBride" <php@riversidedesigns.net>; <php-general@lists.php.net> Sent: Tuesday, January 23, 2001 5:50 PM Subject: Re: [PHP] Help w/ quotes/html and data from MySQL > At 4:47 PM -0500 1/23/01, Shane McBride wrote: > >I have a field in MySQL that holds data that may look like this: > > > ><b>Rose Painting</b>"Looks really nice, blah, > >blah"<b>25.00</b> > > > >Now, I want to pull that data back into a form <textarea> to edit. > >Here's how I have unsuccessfully been doing it: > > > >?> > >.... beginning code > ><td>Description:</td> > ><td><textarea name=\"description\" value='$description' > >cols=\"50\" > >rows=\"5\"></textarea></td> > >...ending code > >?> > > > >I looks like that the embedded html in the MySQL data is actually > >being "rendered" (for the lack of a better term). > >How can I get the whole chunk of data back into the form? > > > > > Well, if you're using PHP: > > echo > '<td>Description:</td>', > '<td><textarea name="description" cols="50" > rows="5">', > htmlentities($description), > '</textarea></td>' > ; > > Presumably, other web development languages have an equivalent > construct to PHP's htmlentities(). > > Also, the value of a textarea tag is not put in a 'value' attribute > within the tag as with the INPUT tag; it is put in the textarea > 'container' - that is, between the <textarea> and </textarea> tags. > > - steve > > > -- > +--- "They've got a cherry pie there, that'll kill ya" ------------------+ > | Steve Edberg University of California, Davis | > | sbedberg@ucdavis.edu Computer Consultant | > | http://aesric.ucdavis.edu/ > http://pgfsun.ucdavis.edu/ | > +-------------------------------------- FBI Special Agent Dale Cooper ---+ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#36285) next »