The cause of giddiness of the kind that you had is likely to be due to either problem in brain or inner ear
. The diagnosis will have to be made depending on full description of the event like how long it lasted, whether similar attacks were there previously? after that investigations will include scans for the brain and heart check up. Pain in ribs may point to a heart related problem.