Actually, Actually,
I think I need to clarify why I felt I could answer this post, without more information than he gave.
When reading:
When I enter data through a form, using javascript trim function I remove all the left/right spaces if there is any before inserting in MYSQL,
...In the PHP forum, I think it's correct to tell him to use trim(), as it's not good to do things like this client-side (compatability issues, abuse, etc.), which I'm sure you agree on (most people do anyways).
And.. When I first gave him that tip, I thought it might be clever to the same time make him write proper HTML-code, as sloppy code can affect how the HTML is interpeted.
If you read his question one more time, he did not ask "Why cant I see any data from my database?", but he asked:
Looks like I am geting spaces from the database. because even if there is one word in the database my textarea scroll bar gets activated.
I don't know why I am geting spaces?
If the HTML code is faulty, that may affect how it is interpered in his browser, as I stated above.
I do not know if he tested in several browsers, if he tried echo'ing out the variable, etc. I agree this should be in his post and maybe he should have tested this before he tried asking us.
But even so, he says he gets the scrollbar, even if it's only one character. If he has one character, I guess the problem can not be register_globals, as then he would have no characters (NULL).
I might have mis-understood here, but the way I interpeted it, I came to the conclusion that his problem is not database->PHP, but rather javascript/html -> PHP.
It might also just be PHP -> HTML, which we would know more about, if he told us more information (as you requested, and I think it's good of you to request more information).
Therefore, I gave him the suggestion to clean up his coding and remove the javascript, to use trim() in PHP instead, in cooperation with strip_tags() and mysql_real_escape_string().
If that does not work, and if I understood him right, that he gets data from the database, I would recommend printing out the variable like so:
echo "#{$myvar}#";
Olav Alexander Mjelde
Admin & Webmaster