in reply to if statement problem using mysql

print its value (Tip #3 from Basic debugging checklist):
print ">>>$log<<<\n";