Du använder backticks[används för kolumner ] för variabler. Använd enstaka citattecken. Prova koden nedan
$sql="INSERT INTO registration (enrollno, fname, lname, fathername, coursename, yearsem, facultyno, hostel, roomno, email, mobileno, peradd, district, state, amount, pwd, tnc) VALUES ('$enrollno','$fname','$lname','$fathername','$coursename','$yearsem','$facultyno','$hostel','$roomno','$email','$mobileno','$peradd','$district','$state','$amount','$pwd','$tnc')";