Is it bad to publish a scientific paper with wrong results? I was working during the last year on developing an approach that determines human age class (young or old), but after I got exciting results I've discovered that I made a mistake when implementing some lines of code. I think that the mistake is a bit critical because I was comparing my approach and literature's ones. The mistake I made was during the classification task, where the data was entered in the right way but the experience was badly managed.

What should I do? Do I have to stay quiet or do I have to fix it? Note that the paper is not yet published nor peer reviewed.
Publishing things that you know are erroneous is a good way to get a really bad scientific reputation. Depending on how severe it is, it might go so far as to be labelled fraud and formally sanctioned, basically killing your career.

If it's important, then yes, you need to fix it.

If it's not published yet, then fix it before you publish it.  If it's published, then you will need to submit a correction or possibly even a retraction.  Good scientists do this, and it's much better to acknowledge your errors and retract than to have others expose you as a liar.