COMPARE_RESULT=sudo php /home/xxx/compareMD5.php
This will not do what you think. You need to enclose the command in backticks so that it runs and COMPARE_RESULT will be set to its output.
COMPARE_RESULT=`sudo php /home/xxx/compareMD5.php`
When you compare strings, you need to use ==. = is for assigning values (like you've done above).
if [ "$COMPARE_RESULT" == "ok" ]; then
echo error log is not changed
EXITCODE=10
elif [ "$COMPARE_RESULT" == "mysqlerror" ]; then
echo mysqlerror
EXITCODE=11
elif [ "$COMPARE_RESULT" == "apacheerror" ]; then
echo apacheerror
EXITCODE=12
fi