Problems get solved by considering what's going on, identifying the difference to what should happen, and then eliminating that difference. Neither of you appear to be doing any of that right now.
You're always going to run into situations where things don't work the first time around, having the "correct code" at hand isn't useful when it doesn't apply to the current situation. Better if you ask questions about your situation, consider what information you need, how you can approach your situation, what's preventing you from solving it.
And in particular, most people aren't interested in telling you how to do something once, questions like these make it seem like you're trying to avoid to learn anything, in which case you aren't making yourself deserving of asking other people for their time to do what you won't