undo everything you have done to the sql.
go to the project page and download the version you had which would have been v4.x.x
upload it overwriting everything but your config.php file and the images folder.
once this is done then do the upgrades once you get to v5.0.2 all you have to do is overwrite everything but your config.php and you are good to go.
it is not a hard thing to do the only thing that will be hard is the sql part. but you have this post to guide you since you changed the sql per this post.
if you follow everything in this post it will work just fine.
Join us on Twitter