There is no mySQL or mySQLi code in this example, so I don't think it is the problem. Please attach the page. I'm assuming the issue is in the Insert Record to Database code on the top of the page.
What exactly "isn't working"... please describe the issue or error so I know what I'm looking for.