
875 So.2d 180 (2004)
Franklin Rashad BODDIE
v.
STATE of Mississippi.
No. 2001-CT-00304-SCT.
Supreme Court of Mississippi.
June 10, 2004.
*181 J. Ronald Parrish, attorney for appellant.
Office of the Attorney General by Charles W. Maris, Jr., attorney for appellee.

ON WRIT OF CERTIORARI
CARLSON, Justice, for the Court.
¶ 1. On August 16, 1999, Franklin Rashad Boddie pled guilty to the crime of transfer of cocaine. On March 22, 2000, Boddie filed in the Pike County Circuit Court a petition for post-conviction relief (PCR) seeking vacation of the judgment of conviction and sentence imposed pursuant to his guilty plea. After a hearing was conducted on December 4, 2000, the circuit court, the Hon. Keith Starrett, presiding, denied Boddie's PCR motion. Feeling aggrieved, Boddie appealed that ruling arguing that his plea to that charge was void due to language used by the trial court which Boddie argued, in essence, dismissed the charge of transfer of cocaine. He also argued that there was no factual basis for the plea. A unanimous Court of Appeals affirmed, Boddie v. State, 850 So.2d 1205 (Miss.Ct.App.2002), and we granted certiorari. We affirm because (1) the trial court did not dismiss the charge of transfer of cocaine, but merely made a ruling on the evidence, and (2) the record as a whole established an adequate factual basis for the plea.

FACTS AND PROCEEDINGS IN THE CIRCUIT COURT
¶ 2. Boddie was indicted for the crimes of transfer of cocaine and aggravated assault. Boddie filed a motion to quash the indictment, alleging that the grand jury did not have sufficient evidence to indict him. After an evidentiary hearing, the trial court entered an order stating that it was "necessary and proper that this [c]ourt make an adjudication on evidentiary matters in order to resolve pending disputes herein." (emphasis added). Therefore, the trial court specifically stated that the order which was being entered was a ruling on the admissibility of the evidence.
¶ 3. The State informed the court that in order to prove that Boddie transferred cocaine, the prosecution intended to introduce the alleged expert testimony of the drug addict to whom the cocaine was delivered. The trial court held that the "opinion of a drug user that the substance is cocaine is not sufficient." The trial court further stated that "[t]o allow prosecution for the transfer of cocaine indictment when the court has made this ruling, would be *182 improper. The parties have stipulated as to what the proof would be and therefore, this court feels comfortable in granting what is in effect a directed verdict." The trial court also ruled that the statement made by the defendant that he did in fact transfer the cocaine could be used against him to prove motive under the aggravated assault indictment. This order did not quash the indictment.
¶ 4. After the entry of the trial court's order, plea negotiations continued between the State and the defendant. On August 16, 1999, Boddie entered a plea of guilty to the transfer charge, in return for the State's agreeing to recommend a sentence of twenty years with ten years suspended and served on post-release supervision[1] and a fine of $2,000. The State also agreed not to prosecute the aggravated assault and armed robbery charge. At the sentencing hearing, the trial court made sure everyone was in agreement that the previous order entered was a ruling on evidentiary matters and the indictment had not been dismissed. All parties, including the defendant, stated that they agreed that the indictment was outstanding as to the transfer of cocaine charge. The trial court made sure Boddie was aware of his right to a trial by jury and the right to appeal any conviction pursuant to a jury verdict. The trial court also ascertained that Boddie was aware that a plea of guilty waived those rights. Boddie informed the trial court that he was pleading guilty to the charge of transfer of cocaine because he was in fact guilty of the offense. He also stated that he was "satisfied the State [could] prove beyond a reasonable doubt that [he was] guilty of the offense charged, unlawful transfer of cocaine." Boddie's mother was also present at this sentencing hearing. She stated that after having been present during the discussions between Boddie and his attorney, she was satisfied that Boddie was aware of consequences of his guilty plea. After finding that Boddie was competent and that he voluntarily, knowingly and intelligently waived his rights and entered a plea of guilty, the trial court accepted Boddie's guilty plea.
¶ 5. On April 8, 1999, Boddie, through new counsel, filed this petition for post-conviction relief. In his petition, Boddie argued that he should not have been allowed to plead guilty to the charge of transfer of cocaine because the trial court's ruling effectively dismissed the charge against him. On December 4, 2001, after hearing arguments from both parties, the trial court again stated that the indictment against Boddie was not quashed. The trial judge held that he:
basically was giving an opinion that with that evidence I didn't think the State would prevail, because if they didn't have the substance then the case law was against it, and even armed with that ruling the defendant chose to plead guilty to the offense of transfer of cocaine. So, it would just be [an] injustice to allow that to happen. It would defy reason and logic, and the defendant was very well aware of the circumstances, as was his attorney and his Mother who signed off on the Know Your Rights Form.
*183 The trial court thus denied Boddie's PCR motion.

DISCUSSION
¶ 6. Our standard of review of the trial court's denial of a PCR motion is clear. We will not reverse the factual findings of the trial court unless they are clearly erroneous. Brown v. State, 731 So.2d 595, 598(¶ 6) (Miss.1999). Questions of law are reviewed de novo. Id.
¶ 7. In State v. Peoples, 481 So.2d 1069 (Miss.1986), the defendant moved to quash the kidnapping indictment, alleging insufficient evidence. After hearing arguments from all parties, the trial court quashed the kidnapping indictment. Id. at 1070. This Court held that the ruling by the trial court was erroneous and the matter should have proceeded to trial. Id. This Court stated that "[n]either a motion to quash nor any other pretrial pleading can be employed to test the sufficiency of evidence." Id. (citing State v. Grady, 281 So.2d 678, 680 (Miss.1973); State v. Peek, 95 Miss. 240, 243, 48 So. 819 (1909)). See also Callahan v. State, 419 So.2d 165, 168 (Miss.1982); State v. Bates, 187 Miss. 172, 179, 192 So. 832, 834-35 (1940). This Court determined that "if the procedure employed by the trial court in this case were permitted, it would have a monumental effect on our criminal justice system." As this Court observed in Grady,
The proper time to test the sufficiency of the evidence to support any indictment is when the case is tried on its merits. Then if the evidence on behalf of the state is insufficient to support the charge made in the indictment, on proper motion, the trial court should so hold and direct the jury to find the accused not guilty, otherwise, the case should be submitted to the jury to determine the guilt or innocence of the accused. 281 So.2d at 681-82. Therefore, it would have been improper for the trial court to quash the indictment for transfer of cocaine based on insufficiency of the evidence. The trial court made an evidentiary ruling that the person to whom the drugs were sold could not testify as an expert witness. The trial judge also stated, in his opinion, that if that was the only evidence the State had to present, he did not feel its case would be successful at trial. However, this opinion did not amount to a directed verdict, nor did it amount to a quashed indictment.
¶ 8. As to Boddie's argument that there was no factual basis for his guilty plea, this Court is not limited to the transcript of Boddie's guilty plea hearing, but we are allowed to review the record as a whole. Gaskin v. State, 618 So.2d 103, 106 (Miss.1993). See Corley v. State, 585 So.2d 765, 767-68 (Miss.1991). While the transcript of the guilty plea hearing contains no specific reference to a factual basis for the charge of transfer of cocaine, Boddie made a statement, which the trial court ruled to be admissible, in which he admitted to the crime alleged in the indictment. Boddie also acknowledged at his guilty plea hearing that he was satisfied that the State could prove, beyond a reasonable doubt, that he was guilty of the crime of transfer of cocaine. Thus, based on the totality of the evidence, there existed a factual basis for Boddie's plea of guilty to transfer of cocaine.

CONCLUSION
¶ 9. An evidentiary hearing was held before the trial judge where he ruled that the opinion of a drug user was not sufficient to prove transfer of a controlled substance. Although he incorrectly made a statement about a directed verdict, the trial judge later corrected his misstatement before Boddie pled guilty to the *184 charge, informing all parties that the indictment had not been quashed, merely a ruling on the evidence had been made. Knowing this fact and with the consent of his attorney, Boddie consciously and knowingly entered a plea of guilty to the charge of transfer of cocaine. Had he not pled guilty, this case would have proceeded to trial because the indictment was never quashed. Finally, based on the totality of the record, there existed a factual basis for the guilty plea.
¶ 10. For the foregoing reasons, we affirm the judgments of the Court of Appeals and the Pike County Circuit Court.
¶ 11. AFFIRMED.
SMITH, C.J., WALLER AND COBB, P.JJ., EASLEY, DICKINSON AND RANDOLPH, JJ., CONCUR. GRAVES, J., DISSENTS WITH SEPARATE WRITTEN OPINION. DIAZ, J., NOT PARTICIPATING.
GRAVES, Justice, dissenting.
¶ 12. Franklin Rashad Boddie was indicted for sale of cocaine and aggravated assault for giving two rocks of crack cocaine to a drug addict and/or her friend and then retaliating when payment was not forthcoming. An order of nolle prosequi was entered, and he was later reindicted for transfer of cocaine and aggravated assault. The record is not clear as to how the State learned of the transfer, but it indicates that the State never had possession of the crack cocaine and it was never chemically analyzed because it was smoked by the drug addict. The defense moved to quash the indictment with regard to the count of transfer of cocaine, and the parties stipulated as to what the proof would be on that charge. Apparently, the State planned to call the drug addict, who smoked the substance in question, as a M.R.E. 702 expert to testify that the substance was indeed crack cocaine. The trial judge denied the motion to quash, but found that there was insufficient evidence for the State to prove the transfer charge and granted "what is in effect a directed verdict." Thereafter, Boddie entered a guilty plea to the transfer of cocaine charge and the State nolle prossed the aggravated assault charge. The majority of this Court fails to recognize or adequately address the determinative issue raised by Boddiewhether there was a factual basis for his plea. Instead, the majority discusses at great length the moot issue of whether the trial court dismissed the charge of transfer of cocaine. In doing so, the majority ignores precedent and misapprehends the contents of the record on appeal in this matter. Because I would find that there was no factual basis for Boddie's guilty plea, I must respectfully dissent.
¶ 13. Specifically, Boddie asserts that there was no factual basis for his guilty plea and that the Court of Appeals' decision overrules Gaskin v. State, 618 So.2d 103 (Miss.1993); Lott v. State, 597 So.2d 627 (Miss.1992); Harris v. State, 723 So.2d 546 (Miss.1997); State v. Thornhill, 251 Miss. 718, 171 So.2d 308 (1965); Austin v. State, 734 So.2d 234 (Miss.Ct.App.1999), and their progeny. Boddie's argument is based on Mississippi Uniform Circuit and County Court Rule 8.04(A)(3), which states:
Before the trial court may accept a plea of guilty, the court must determine that the plea is voluntarily and intelligently made and that there is a factual basis for the plea. A plea of guilty is not voluntary if induced by fear, violence, deception or improper inducements. A showing that the plea of guilty was voluntarily and intelligently made must appear in the record.
*185 ¶ 14. The Court of Appeals found that the trial court made only an evidentiary ruling, despite the "unfortunate" language in the order, because it was not possible to grant a directed verdict on a motion to quash the indictment. Boddie v. State, 850 So.2d 1205, 1208 (¶ 11) (Miss.Ct.App.2002). The Court of Appeals further relied on cases presented in the State's brief setting out that the proper time to test the sufficiency of the evidence is when the case is tried on its merits. See State v. Peoples, 481 So.2d 1069, 1070 (Miss.1986); State v. Grady, 281 So.2d 678, 681 (Miss.1973).
When the trial judge made the evidentiary ruling, not one scintilla of trial evidence had been introduced. While the effect of the trial judge's ruling was to forewarn the State of a serious evidentiary impediment in the trial of its case based on the stipulated facts, the ruling could not prohibit the State from prosecuting Boddie on the indictment.
Boddie, 850 So.2d at 1208(¶ 12). The Court of Appeals acknowledged that the plea transcript reveals no factual basis, but found that the omission is not fatal because of a statement made by Boddie to police and the statement of the drug addict(s) involved. The majority of this Court also relies on this statement as proof that a factual basis did exist. However, I disagree. At the time the trial judge made the ruling on the motion to quash, both the statement to police and that of the drug addict(s) had been introduced and were mentioned in the order. The parties stipulated as to what the proof would show, although such is not included in the record. The trial judge found that there was not sufficient evidence to prosecute the transfer charge based on the proof, or lack thereof, that the majority now says establishes a factual basis.
¶ 15. The majority states that the trial court was merely making an evidentiary ruling and downplays that the trial court also said "[t]o allow prosecution for the transfer of cocaine indictment when the Court has made this ruling, would be improper. The parties have stipulated as to what the proof would be and therefore, this Court feels comfortable in granting what is in effect a directed verdict." I agree that the trial court was making an evidentiary ruling. However, the evidence in a case generally consists of the facts. A finding that the evidence, including Boddie's statement, was insufficient to allow prosecution requires a thorough analysis of whether that same insufficient evidence can provide a factual basis for a guilty plea.
¶ 16. The Court of Appeals' decision sets out that "the transcript of the sentencing hearing removes any doubt as to the nature of the trial judge's ruling." Boddie, 850 So.2d at 1208 (¶ 11). However, the sentencing hearing consisted of a brief statement by two of Boddie's relatives, the judge pointing out that Boddie had no prior felonies, and a discussion of the terms of the plea bargain. None of that sheds any light on the judge's ruling. Likely, the reference should have been to the hearing on the entry of the guilty plea, which also does not remove any doubt. The judge did say "[t]here was a ruling made regarding evidence on this case. Does everyone agree that it was only an evidentiary ruling and that the Indictment is still standing?" However, there is nothing that establishes the nature of the judge's ruling on the previous motion. Other than the actual order itself, the transcript from the hearing on the petition for post-conviction relief offers more insight. At that hearing, the trial court stated:
There was a motion filed to quash the indictment by the defense attorney, Mr. Charles Miller.... Now, maybe I was *186 I misstated what I intended to say, but this wasmotions to quash are not allowed. The Court has no authority to quash an indictment unless there is some technical reason that requires it to be quashed. The indictment is brought by the grand jury and should have been presented for trial. I was obviously concernedthe Court heard the testimony and determined that there is no way that the State can sustain a conviction unless it has some of the evidence, and I think it was stipulated that the State did not. I stated that the testimony is not sufficient to allow the prosecutionto allow prosecution for the transfer of cocaine when the Court has made this ruling would be improper, or it is stipulated as to what the proof would be, and, therefore, the Court feels comfortable in granting what is in effect a directed verdict. Well, at that time, and had jeopardy attached, had the trial actually come about and the case been presented in the proper form before the jury this would have been a directed verdict, and it would have been res judicata to anything that had gone on before. But, thisthis order was entered and there was apparently some plea bargaining.... The defendant got the benefit of his bargain.... To allow the defendant to come back and say that the, this opinion quashed the indictment when the defendant, his mother and his attorney all agreed that it apparently had not because it was a pending indictment. They agreed to it and entered a plea of guilty to it. That would be a significant mistake and it would just be wrong, there wouldn't be any justice in allowing that to happen.
(emphasis added).
¶ 17. The issue presented here is not whether the indictment was quashed, but rather whether there was a factual basis for Boddie's plea. As the trial judge pointed out, he could not procedurally quash the indictment, which also included a second charge of aggravated assault. The trial court found, as set out previously, that there was no basis to allow prosecution of the transfer of cocaine charge. The transcript of the post-conviction relief hearing indicates the relief was denied because of the benefits of the plea bargain, not because there was a factual basis for the plea.
¶ 18. The Court of Appeals also does not go so far as to find that a factual basis did exist, but instead merely states "[b]ased on these facts, we cannot say that a sufficient factual basis did not exist to support the trial judge's acceptance of Boddie's guilty plea. Accordingly, we reject Boddie's argument in this regard." Boddie, 850 So.2d at 1210(¶ 19).
¶ 19. A factual basis for a plea may be established by the admission of the defendant. Templeton v. State, 725 So.2d 764, 766 (Miss.1998). However, the admission must contain factual statements constituting a crime or be accompanied by independent evidence of guilt. Reynolds v. State, 521 So.2d 914, 917 (Miss.1988). This Court has held that a factual basis is not established by the mere fact that a defendant enters a plea of guilty. Lott, 597 So.2d at 628.
¶ 20. The majority of this Court cites Gaskin v. State, 618 So.2d 103, and Corley v. State, 585 So.2d 765 (Miss.1991), for the proposition that a factual basis is established by the totality of the evidence, i.e., Boddie's statement and acknowledgment that the State could prove his guilt. However, both of these cases can be distinguished.
¶ 21. In Gaskin, this Court found a factual basis for accepting the defendant's guilty pleas to murder and armed robbery *187 where Gaskin filed a petition to plead guilty that contained factually specific statements with regard to the crimes he had committed and there were sworn statements of two eyewitnesses to the crime. The Court found that Gaskin's petition combined with the question-and-answer session during the plea colloquy were not enough under Corley to establish a factual basis, but that a factual basis was established when both were considered along with the sworn statements of the eyewitnesses.
¶ 22. In Corley, this Court found a factual basis for the defendant's guilty plea where the District Attorney recited during the plea hearing the facts the State's case would show if the matter proceeded to trial. The Court held that:
What Rule 3.03(2) requires is that, before it may accept the plea, the circuit court have before it, inter alia, substantial evidence that the accused did commit the legally defined offense to which he is offering the plea. What facts must be shown are a function of the definition of the crime and its assorted elements.
Id. at 767. Citing United States v. Broce, 488 U.S. 563, 570, 109 S.Ct. 757, 764, 102 L.Ed.2d 927 (1989), the Court further said "[i]n the end there must be enough that the court may say with confidence the prosecution could prove the accused guilty of the crime charged, `that the defendant's conduct was within the ambit of that defined as criminal.'" Corley, 585 So.2d at 767.
¶ 23. Here, Boddie did not admit to the elements of any factually specific crime, he merely entered a plea and responded "yes, sir" when asked if he was guilty. The trial court did not set out the elements of any factually specific crime and had previously found that the State could not prove the elements of the transfer crime. Reliance on the statements of crack users or Boddie's unsworn statement to police to establish a factual basis is improper because the trial judge had already found that evidence not sufficient to allow prosecution of the charge. The majority fails to address the fact that this evidence was considered by the trial court prior to the ruling that the evidence was insufficient. The majority also fails to distinguish the precedent regarding the factual basis issue. The trial court cannot "say with confidence the prosecution could prove the accused guilty of the crime charged" as required under Corley when it has already said that the prosecution cannot prove the accused guilty of the crime charged.
¶ 24. The majority erroneously asserts that Boddie "stated that he was `satisfied the State [could] prove beyond a reasonable doubt that [he was] guilty of the offense charged, unlawful transfer of cocaine.' " In reality, the statement quoted by the majority and attributed to Boddie was made by the trial court in the form of a question, to which Boddie answered "[y]es, sir."[2] Further, nothing in the plea colloquy establishes a factual basis for the transfer charge. There is only Boddie answering "yes, sir" to various questions by the court, and this Court has previously said that does not establish a factual basis.
¶ 25. This case is similar to Carter v. State, 775 So.2d 91 (Miss.1999), where this Court affirmed the Court of Appeals on certiorari, holding that there was sufficient evidence to support Carter's plea of guilty *188 to seduction. However, Carter can be distinguished because there was much more evidence presented and an in-depth plea colloquy, during which Carter admitted conduct "within the ambit of that defined as criminal." See id. at 97, 98. In both Carter and Lott, the defendants actually told the court what happened during the crime. Also, the analysis presented in the dissent in Carter offers insight into this requirement.
The purpose of the factual basis prerequisite is to require the trial court to delve beyond the admission of guilt and make its own determination that there is substantial evidence that the pleader did in fact commit the crime he is charged with and is not pleading guilty for any other objectionable reason. Gaskin v. State, 618 So.2d 103, 106 (Miss.1993). Finally, the record at the time of the guilty plea must provide the factual basis. Gaskin v. State, 618 So.2d at 106; Lott v. State, 597 So.2d at 628; Corley v. State, 585 So.2d at 768.
Carter, 775 So.2d at 99 (Pittman, P.J., dissenting).
¶ 26. A factual basis is not established when the record does not include the stipulation by the parties of the proof to be offered, the trial court previously found insufficient evidence to allow prosecution for the crime charged, and neither the plea colloquy nor the transcript of the post-conviction relief hearing set out a factual basis for the plea. Because I would find that the trial court failed to establish a factual basis for the plea and that the judgments of the Court of Appeals and the Circuit Court of Pike County should be reversed, I must respectfully dissent.
NOTES
[1]  Pursuant to Miss.Code Ann. § 47-7-34, the "maximum amount of time that the Mississippi Department of Corrections may supervise an offender on the post-release supervision program is five (5) years." The practical effect of the sentence would be that, just like supervised probation or a suspended sentence (with no MDOC supervision), only five years of Boddie's post-release supervision would be under the direction of the MDOC, with the remaining five years being served in essence like "unsupervised probation" or a suspended sentence.
[2]  The majority also attributes statements to Boddie's mother that the record establishes she did not actually make. The majority is referring to Boddie's mother responding "[y]es, sir" to two questions by the trial court as to whether she had been present during discussions with Boddie and his lawyer and whether she was satisfied he understood what he was doing.
