try and catch with a prepared statement
问题 I have had a very hard time with this query and it was suggested to me to learn try and catch blocks to more easily figure out what is wrong. So this is my first attempt at it. I am getting the error for my @stmt2 not being defined for my print_r($stmt2) line. Notice: Undefined variable: stmt2 This is my attempt at the try catch. Am I doing anything wrong with it for this error to come up? try { $con = mysqli_connect("localhost", "", "", ""); if (mysqli_connect_errno()) { throw new Exception(