In the historical centre of Cordoba there are a number of cheap hotels and
hostels. If you book in advance you might get one right on the Mezquita
square with a view right into the walls of the Mosque. Check out this list of
budget accommodation in
Cordoba.