comparing strings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • satishkuku
    New Member
    • Mar 2007
    • 1

    comparing strings

    I entered string in the html form... and stored in Mysql database.

    After retrieving from the database .. i am comparing orginal string and read string from database.... it is giving both are not same...Why this happens??

    Can any one suggest way to get answer that both string are same...??
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Try outputting the original string and the retrieved string to see if they are, in fact, equal.

    Make sure you are using the .equals() method, or possibly the .equalsIgnoreCa se() method.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by satishkuku
      I entered string in the html form... and stored in Mysql database.

      After retrieving from the database .. i am comparing orginal string and read string from database.... it is giving both are not same...Why this happens??

      Can any one suggest way to get answer that both string are same...??
      As Gannon said. The more common reason for this will be that you may have used == instead of the .equals method to compare the strings. If this is not the case, you may need to post the code both for inserting and retrieving the String from the database.

      Comment

      Working...