My PHP program doesn't run

FIRST FILE: index.php

<!DOCTYPE html>
Test program
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<a href="\testitems\01a.mp3">Play the tape</a>

<form action="insert.php" method="POST">
Please choose the right answer!!!!

<table style="width: 20%">
<th>Right <input type="radio" name="a" value="a" required/> </th>
<th>Light<input type="radio" name ="b" value="b" required/> </th>
<th>Can't tell<input type="radio" name ="c" value="c" required/> </th>
<input type="submit" value="Enter"/>




SECOND FILE: insert.php



$conn = mysqli_connect("localhost","root","","quizbank");
mysqli_query($conn, "SET NAMES 'UTF8'") or die("ERROR: ". mysqli_error($conn));

$sql="INSERT INTO users (user_id,item_id,response)
('$_POST[a]','$_POST[b]','$_POST[c]') ";

if (!mysql_query($sql,$conn))
die('Error: ' . mysql_error());
echo "1 record added";



Leave a Reply