Well, the way I fixed it might not be the way you want to go about it, since it was a white-knuckle ride from start to finish!
You might want to check out this solution first:
But what I did was to make a backup of my database. You'll need to use phpMyAdmin's 'Export' utility to grab your database.
Then I deleted everything -- and that's the scary part. I got rid of all the files and the database itself.
I then re-installed wordpress as if it were a completely fresh install.
Then I re-imported the important tables back into my databse. So, from the fresh install, I emptied every table except for options, users and usermeta. Then, working with the exported backup from the old database, I re-filled each table with my old posts, comments, postmeta etc.
I've kept this deliberately brief so it'll only make sense if you're familiar with the wordpress database and phpMyAdmin -- don't attempt it if you're not!