No statement, admission or confession made by a defendant to the court or to any officer thereof during the examination and investigation referred to in Section 15-19-1 shall be admissible as evidence against him or his interest; provided, however, that the court may take such statement, admission or confession into consideration at the time of sentencing after the defendant has been found guilty of a crime or adjudged a youthful offender.
Ala. Code § 15-19-5 (1975)