So I am trying to create this form however, I am not able to enter the data into the table. Whenever I click on continue button, nothing really happens. I don't get an error or anything. and when I check my database, the values have not been added. Idk how its happening. I spent hours trying to understand what the issue is but i am not able to identify it and it got to the point where I felt hopeless and decided to post this question so please help me. Here's my code:
<?php
$conn = new mysqli("localhost", "root", "", "KFC");
if(isset($_POST['Submit_btn']))
{
session_start();
$RID= $_POST['R_ID'];
$Name= $_POST['Name'];
$S_Description=($_POST['S_Description']);
$L_Description=($_POST['L_Description']);
$Nutritional_value=($_POST['Nutritional_value']);
$Cost=($_POST['Cost']);
$TypeOfMeal=($_POST['TypeOfMeal']);
$SubmittedBy=($_POST['SubmittedBy']);
$sql= "INSERT INTO `recipe`(`R_ID`, `Name`, `S_Description`, `L_Description`, `Nutritional_value`, `Cost`, `TypeOfMeal`, `SubmittedBy`) VALUES ($RID,$Name,$S_Description,$L_Description,$Nutritional_value,$Cost,$TypeOfMeal,$SubmittedBy)";
mysqli_query($conn,$sql);
}
mysqli_close($conn);
?>
<html>
<body>
<div id="bodyContent">
<h1> Registration </h1>
</div>
<form method="post">
<table>
<tr>
<td>R_ID: </td>
<td>
<input type="text" name="R_ID" class="textInput">
</td>
</tr>
<tr>
<td>Name: </td>
<td>
<input type="text" name="Name" class="textInput">
</td>
</tr>
<tr>
<td>Small Description: </td>
<td>
<input type="text" name="S_Description" class="textInput">
</td>
</tr>
<tr>
<td>Long Description: </td>
<td>
<input type="text" name="L_Description" class="textInput">
</td>
</tr>
<tr>
<td>Nutritional value: </td>
<td>
<input type="text" name="Nutritional_value" class="textInput">
</td>
</tr>
<tr>
<td>Cost: </td>
<td>
<input type="number" name="Cost" class="textInput">
</td>
</tr>
<tr>
<td>Type Of Meal: </td>
<td>
<input type="text" name="TypeOfMeal" class="textInput">
</td>
</tr>
<tr>
<td>UserID: </td>
<td>
<input type="Number" name="SubmittedBy" class="textInput">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="Submit_btn" value="Continue">
</td>
</tr>
</table>
</form>
</body>
</html>