Do you have your RFID reader hooked up exactly as shown in the code?
/*
We need to define MFRC522's pins and create instance
Pin layout should be as follows (on Arduino Uno):
MOSI: Pin 11 / ICSP-4
MISO: Pin 12 / ICSP-1
SCK : Pin 13 / ICSP-3
SS : Pin 10 (Configurable)
RST : Pin 9 (Configurable)
look MFRC522 Library for
other Arduinos' pin configuration
*/