MySQL Forums
Forum List  »  Newbie

STRCMP doesn't work
Posted by: Wim Roffel
Date: January 02, 2021 09:20AM

I have a query that looks for a certain string in a field. So you get code like:
AND !STRCMP(myfield,"'.mysqli_real_escape_string($myvar).'")';

I tried variations like leaving out mysqli_real_escape_string() but the outcome is always the same: there is never a match.

Yet:
- the strings have the same length
- on visual inspection they are the same.
- when I retrieve the string from the database and compare it with PHP's strcmp function they match.

My string is rather short (63 positions), it contains Hebrew script and linefeeds. But I cannot find documentation that this should be a problem. So I am puzzled. What could this be?

Options: ReplyQuote


Subject
Written By
Posted
STRCMP doesn't work
January 02, 2021 09:20AM
January 02, 2021 01:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.