Huh, basically the same exact stuff happened for me up until the part where you'd gave up, like my brother (and friend) getting me the job, and how it was all set up. I was nervous, but it was my first job and some of the answers, while I didn't believe were good, I told them, and after it all, he said right there that I got the job and said I seemed confident, even though I wasn't very. I was less nervous when I was in there though because each step, each question answered, was closer to finishing.
You basically just have to look confident and seem like a friendly person to be around, and you will get the job, which of course doesn't apply to every job, but certainly the one you were going for. All you have to do is answer the questions, even if you don't think they'll like the answers, be honest and act confident. Also, don't give up, and trust me, there are a lot of people out there worse than you, and have it worse than you, so go in and think of all the great things that will happen once you get the job and not about what will go wrong in the process.
One other thing, don't be afraid to ask questions. If it helps, I can relate. I don't have a job, haven't had one for a few years now. There are a few reasons behind that, but the one most reminiscent to your problem is the interviewing process, it's really hard to work up the confidence and motivation to go out and get a job for some, and that's something that affects me. When it comes to the interview, I just wish there was a way to bypass it, but there's not, so you have to get through it.