Children need to learn how to behave in public and we, as parents, need to learn (usually by experience) how to manage their bad behaviour in public too. I'm a big believer in consistency, so whatever we do at home to manage bad behaviour should be done in public (where possible). I've put my ds (age 6) in timeout multiple times when we are out and if the behaviour isn't quite that bad he just goes & sits down within a metre or two of me if I'm busy (eg. at the checkout).
As for my dd if I stayed home/near the car in case she cried or threw a tantrum I'd never get out. She screamed multiple times in the trolley at Bunnings yesterday when I took her there to get LOTS of things ... all she wanted to do was play on the playground. I tried my best to get all the things I came for and then left. It's hard to get out as it is, I can't let her stop me just cause she is feeling grumpy (she did get a short play on the playground though).
As for people looking at you, try your best to ignore them. They may have been frowning at your child and not at you anyway ... it's going to be hard to tell. All the best!