I cannot be bothered to read the whole post. You pretty much ask us to fix it for you, that isn't our job. We guide you in the right direction on fixing things yourself. Based on the change of syntax highlighting I've seen on the forums, everything that's green should be a string. 'mysql_real_escape_string()' is a function, and there for should be black. Go figure.
Everything we've said (or almost) is there to help you. If you decide not to listen, then it isn't going to help you is it?
I can tell you on your 2nd snippet of code, you have one less } than you should have. You are closing off your IF statements, but your WHILE is left open.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.