Help a Newbie - MySql Result in textarea

This is a discussion on Help a Newbie - MySql Result in textarea within the PHP Language forums, part of the PHP Programming Forums category; I have a script to display mysql query results in a table. I'd like to display the results in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-13-2004
MrWium
 
Posts: n/a
Default Help a Newbie - MySql Result in textarea

I have a script to display mysql query results in a table. I'd like to
display the results in a scrollable textarea. Is there a way to do
this? TIA
Reply With Quote
  #2 (permalink)  
Old 01-13-2004
Tim Van Wassenhove
 
Posts: n/a
Default Re: Help a Newbie - MySql Result in textarea

On 2004-01-13, MrWium <mrwium@yahoo.com> wrote:
> I have a script to display mysql query results in a table. I'd like to
> display the results in a scrollable textarea. Is there a way to do
> this? TIA


You need a group about (x)html and/or css.
textarea { overflow: scroll; }


--
http://home.mysth.be/~timvw
Reply With Quote
  #3 (permalink)  
Old 01-13-2004
Robert Downes
 
Posts: n/a
Default Re: Help a Newbie - MySql Result in textarea

MrWium wrote:
> I have a script to display mysql query results in a table. I'd like to
> display the results in a scrollable textarea. Is there a way to do
> this? TIA


Certainly. Just make sure to escape the data carefully. I use something
like this:

echo "<textarea rows=\"8\" cols=\"45\">";
if(isset($existingvalue))
echo htmlspecialchars(stripslashes($existingvalue));
echo "</textarea>";

That will put the value of the variable into a textarea, as used in a form.

If you don't want a form object, go find out about the iframe element
(though I don't like the iframe element much). Otherwise you'll need to
use JavaScript (evil, evil) to write a scrolling layer object to put
text into. And that will be guaranteed to not work on most browsers (did
I mention that JavaScript is evil?).
--
Bob
London, UK
echo Mail fefsensmrrjyaheeoceoq\! | tr "jefroq\!" "@obe.uk"
Reply With Quote
  #4 (permalink)  
Old 01-15-2004
MrWium
 
Posts: n/a
Default Re: Help a Newbie - MySql Result in textarea

Robert Downes <nospamplease@see.my.signature.con> wrote in message news:<40046b7e$0$61071$65c69314@mercury.nildram.ne t>...
> MrWium wrote:
> > I have a script to display mysql query results in a table. I'd like to
> > display the results in a scrollable textarea. Is there a way to do
> > this? TIA

>
> Certainly. Just make sure to escape the data carefully. I use something
> like this:
>
> echo "<textarea rows=\"8\" cols=\"45\">";
> if(isset($existingvalue))
> echo htmlspecialchars(stripslashes($existingvalue));
> echo "</textarea>";
>
> That will put the value of the variable into a textarea, as used in a form.
>
> If you don't want a form object, go find out about the iframe element
> (though I don't like the iframe element much). Otherwise you'll need to
> use JavaScript (evil, evil) to write a scrolling layer object to put
> text into. And that will be guaranteed to not work on most browsers (did
> I mention that JavaScript is evil?).


Thanks to all for the help. All the best. Mr. Wium
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0