We had a CGI program that was setting empty variables as, for example, account_record="\0". I don’t know what \0 is, but I would like to find out which fields were set this way and if any other fields have some strange data in them.
I’m trying to use a combination of tests such as empty, is_null, and bin2hex to reveal what is in the fields because Navicat and other GUI MySQL tools show the fields as empty even though they are not.
Here’s some of the testing code:
[code]if (empty($row[‘account_record’])) {
$account_record = “Empty”;
} else {
$account_record = $row[‘account_record’];
$account_record_ascii = bin2hex($row[‘account_record’]);
}
print “Acct. Rec.: $account_record \t ASCII: $account_record_ascii
”;[/code]
Here’s what prints out when it runs into one of the fields with \0 in it:
Acct. Rec.: ASCII: 00
When the field is truly empty, it prints out:
Acct. Rec.: Empty ASCII:
Any idea how I can find out what \0 is stored as in these fields and, if something else is hiding there what that data is?
Thanks.