Do I have to use the Trim function every time I insert data from a web page into a database?

Should I use the textbox.text.Trim () function every time I insert any data from a webpage into the database.

Do I just have the habit of using the crop function? Does this affect performance effectively? Should I use every time or only when necessary?

+3
source share
3 answers

I saw many problems with spaces that were added at the end to the text box by accident (for example, logins that mysteriously did not work). So it’s not a bad idea to crop () most text field input as standard practice.

, trim() , , , .

+3

( ), , . , . (*)

, . , ( ), . , . , .

. , , , , / . - , , .

*: : . , BLOB, , - , , .

+1

Use cropping and make sure you create a function to rule out any potential sql poisoning attacks.

php provides you

mysql_real_escape_string();
0
source

All Articles