it actually starts at 1 for Sunday. mysql query for getting the day of week is SELECT DAYOFWEEK(NOW())